From 3d48a03b81423b6ae0d5dcae920a50fb3c08bd8a Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Mon, 7 Oct 2024 14:48:15 -0400 Subject: [PATCH] wlr_damage_ring: Clamp damage region to buffer size --- types/wlr_damage_ring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/wlr_damage_ring.c b/types/wlr_damage_ring.c index 840c872d..e0da90c6 100644 --- a/types/wlr_damage_ring.c +++ b/types/wlr_damage_ring.c @@ -116,6 +116,8 @@ void wlr_damage_ring_rotate_buffer(struct wlr_damage_ring *ring, continue; } + pixman_region32_intersect_rect(damage, damage, 0, 0, buffer->width, buffer->height); + // Check the number of rectangles int n_rects = pixman_region32_n_rects(damage); if (n_rects > WLR_DAMAGE_RING_MAX_RECTS) {