Skip to content

Commit

Permalink
Sanitise buffer damage from compositor
Browse files Browse the repository at this point in the history
Some compositors fail to send properly bounded damage regions. Let's
not crash when that happens.
  • Loading branch information
any1 committed Nov 2, 2023
1 parent 27cd635 commit a53ff1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,9 @@ void wayvnc_process_frame(struct wayvnc* self)
nvnc_fb_set_transform(buffer->nvnc_fb,
(enum nvnc_transform)buffer_transform);

pixman_region_intersect_rect(&damage, &damage, 0, 0, buffer->width,
buffer->height);

nvnc_display_feed_buffer(self->nvnc_display, buffer->nvnc_fb,
&damage);

Expand Down

0 comments on commit a53ff1f

Please sign in to comment.