From edda2929c0ca023699629e5d22d8cc553e2e2821 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 6 Jan 2021 19:09:34 -0800 Subject: poll_events: fix clip bounds check in uv_align This would potentially exceed the clip w/h on odd inputs because it was wrongly adding the cliprect offset while comparing against coordinates already made relative within the cliprect --- src/rmd_poll_events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rmd_poll_events.c b/src/rmd_poll_events.c index af1fecf..6af8cc7 100644 --- a/src/rmd_poll_events.c +++ b/src/rmd_poll_events.c @@ -125,10 +125,10 @@ static void uv_align(XRectangle *cliprect, XRectangle *xrect) * the UV routines will handle the exception - which might temporarily * mean they just lop the odd row/column off the edge. */ - if (rel.width % 2 && rel.width + rel.x < cliprect->x + cliprect->width) + if (rel.width % 2 && rel.width + rel.x < cliprect->width) rel.width++; - if (rel.height % 2 && rel.height + rel.y < cliprect->y + cliprect->height) + if (rel.height % 2 && rel.height + rel.y < cliprect->height) rel.height++; xrect->x = rel.x + cliprect->x; -- cgit v1.2.3