From c15de7d5e2b6d46f0e3e51a9992ac23d87b1998e Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 10 Jul 2020 18:11:30 -0700 Subject: update_image: add some asserts on clipped rect Just some sanity checks to ensure clipping is working properly --- recordmydesktop/src/rmd_update_image.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/recordmydesktop/src/rmd_update_image.c b/recordmydesktop/src/rmd_update_image.c index 52ed478..b48e96b 100644 --- a/recordmydesktop/src/rmd_update_image.c +++ b/recordmydesktop/src/rmd_update_image.c @@ -35,6 +35,8 @@ #include #include +#include + void rmdUpdateImage( Display * dpy, yuv_buffer *yuv, @@ -50,6 +52,15 @@ void rmdUpdateImage( Display * dpy, RectArea *temp; for (temp = *root; temp; temp = temp->next) { + + /* sanity check the clipping, nothing on the reclist + * should go outside rrect + */ + assert(temp->rect.x >= brwin->rrect.x); + assert(temp->rect.y >= brwin->rrect.y); + assert(temp->rect.x + temp->rect.width <= brwin->rrect.x + brwin->rrect.width); + assert(temp->rect.y + temp->rect.height <= brwin->rrect.y + brwin->rrect.height); + if (noshmem) { rmdGetZPixmap( dpy, specs->root, -- cgit v1.2.3