From 5aa5137faed6aa85336b776822aea8ccf2dfa590 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 1 Sep 2021 22:06:50 +0200 Subject: [PATCH] backend/drm: handle drm_surface_blit errors drm_surface_blit returns NULL on error. This can happen e.g. when the source buffer cannot be imported into EGL. Closes: https://github.com/swaywm/wlroots/issues/3154 --- backend/drm/drm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index c32a32b6..546cad5f 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -414,6 +414,9 @@ static bool drm_connector_set_pending_fb(struct wlr_drm_connector *conn, } local_buf = drm_surface_blit(&plane->mgpu_surf, state->buffer); + if (local_buf == NULL) { + return false; + } } else { local_buf = wlr_buffer_lock(state->buffer); }