summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-10 18:11:30 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-11 13:36:42 -0700
commitc15de7d5e2b6d46f0e3e51a9992ac23d87b1998e (patch)
treec4bcc96571b895bf569fdb17b796710d7569f132 /recordmydesktop
parente0e54b16485fa34d416c9a9aaaae2cfab1e1e887 (diff)
update_image: add some asserts on clipped rect
Just some sanity checks to ensure clipping is working properly
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/src/rmd_update_image.c11
1 files changed, 11 insertions, 0 deletions
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 <X11/extensions/shmproto.h>
#include <X11/extensions/XShm.h>
+#include <assert.h>
+
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,
© All Rights Reserved