diff options
author | emersion <contact@emersion.fr> | 2019-02-18 19:42:48 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-02-18 20:15:39 +0100 |
commit | 2a738803b2dfb45b5289540c31dacde56a04885c (patch) | |
tree | 4d6e297dc44aa6f247647a5d4d286e770d7b8ecb | |
parent | fd0b625ab96bc3c54ba01a7a610b53b441236728 (diff) |
backend/drm: fix NULL dereference when unsetting cursor
This segfault happens on multi-GPU systems.
Fixes https://github.com/swaywm/sway/issues/3717
-rw-r--r-- | backend/drm/drm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 635a78e2..e0eed4c2 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -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) { |