aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-09-01 22:06:50 +0200
committerSimon Ser <contact@emersion.fr>2021-09-03 17:57:38 +0200
commit5aa5137faed6aa85336b776822aea8ccf2dfa590 (patch)
tree4e54d9fe81d06612e1a07f44c3d665313977f671
parent7df2ae88facad7e8e186261750645ce51a898993 (diff)
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
-rw-r--r--backend/drm/drm.c3
1 files changed, 3 insertions, 0 deletions
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);
}