From 1f7817613ac632a0c078454460df5be89f1f6144 Mon Sep 17 00:00:00 2001 From: Greg V Date: Mon, 19 Feb 2018 17:59:42 +0300 Subject: [PATCH] compositor-drm: handle null cursor_plane Was crashing when I tried to take a screenshot. Reviewed-by: Pekka Paalanen --- 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 321ee191..9594425f 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -1828,8 +1828,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) {