summaryrefslogtreecommitdiff
path: root/src/common/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/backend.c')
-rw-r--r--src/common/backend.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/backend.c b/src/common/backend.c
index 4c755bd..c8d2caf 100644
--- a/src/common/backend.c
+++ b/src/common/backend.c
@@ -217,9 +217,13 @@ bool yasl_surface_present(struct yasl_surface *s, const struct yasl_framebuffer
fb->size.x <= 0 || fb->size.y <= 0 ||
damage->n < -1 || damage->n > YASL_DAMAGE_MAX)
return false;
- struct yasl_damage_list clipped = {.n = damage->n};
- if (damage->n >= 0) {
+ struct yasl_damage_list clipped;
+ clipped.n = damage->n;
+ if (damage->n < 0) {
+ clipped.bounds = damage->bounds;
+ } else {
clipped.n = 0;
+ clipped.bounds = (struct yasl_rect2i){0};
for (int i = 0; i < damage->n; i++) {
struct yasl_rect2i r = damage->rects[i];
if (r.width < 0 || r.height < 0) return false;