backend/drm: fix NULL dereference when unsetting cursor

This segfault happens on multi-GPU systems.

Fixes https://github.com/swaywm/sway/issues/3717
This commit is contained in:
emersion 2019-02-18 19:42:48 +01:00
parent fd0b625ab9
commit 2a738803b2
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -720,9 +720,8 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
}
struct gbm_bo *bo = plane->cursor_enabled ? plane->surf.back : NULL;
if (drm->parent) {
bo = copy_drm_surface_mgpu(&plane->mgpu_surf, plane->surf.back);
if (bo && drm->parent) {
bo = copy_drm_surface_mgpu(&plane->mgpu_surf, bo);
}
if (bo) {