[PATCH] compositor-drm: handle null cursor_plane
Greg V
greg at unrelenting.technology
Mon Feb 19 14:59:42 UTC 2018
Was crashing when I tried to take a screenshot.
---
On my slightly unconventional setup (FreeBSD amdgpu), after merging
recent changes, pressing the screenshot hotkey was crashing weston.
Debugging revealed that cursor_plane was 0x0 here.
I don't know why exactly, but adding this check fixes it.
libweston/compositor-drm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index ff090907..278bc02d 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -1830,8 +1830,10 @@ drm_output_apply_state_legacy(struct drm_output_state *state)
*/
if (output->base.disable_planes) {
output->cursor_view = NULL;
- output->cursor_plane->base.x = INT32_MIN;
- output->cursor_plane->base.y = INT32_MIN;
+ if (output->cursor_plane) {
+ output->cursor_plane->base.x = INT32_MIN;
+ output->cursor_plane->base.y = INT32_MIN;
+ }
}
if (state->dpms != WESTON_DPMS_ON) {
--
2.16.1
More information about the wayland-devel
mailing list