aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-12-15 12:26:00 +0100
committerSimon Ser <contact@emersion.fr>2020-12-22 15:53:10 +0100
commitad4dae08443dbbe1609b215f9bf375024d32f43c (patch)
treea0c417b5fd82414af5db963e8b538bb42f1bf746 /backend
parentd3bcd63a4002394f86a2d7fe80dcb2d5b4ea5f93 (diff)
backend/drm: error on size mismatch in drm_surface_blit
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/renderer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index b4dddd2a..c3d7e638 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -146,6 +146,12 @@ static struct wlr_buffer *drm_surface_blit(struct wlr_drm_surface *surf,
struct wlr_buffer *buffer) {
struct wlr_renderer *renderer = surf->renderer->wlr_rend;
+ if (surf->width != (uint32_t)buffer->width ||
+ surf->height != (uint32_t)buffer->height) {
+ wlr_log(WLR_ERROR, "Surface size doesn't match buffer size");
+ return NULL;
+ }
+
struct wlr_dmabuf_attributes attribs = {0};
if (!wlr_buffer_get_dmabuf(buffer, &attribs)) {
return NULL;