summaryrefslogtreecommitdiff
path: root/src/sna/sna.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-02-08 21:57:51 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-02-08 22:01:09 +0000
commit357a798156b10af440dc674cbe580aa127793444 (patch)
treed0d1441262cac3d68269eaf0fc2a93ce99118af8 /src/sna/sna.h
parent0c2ff5532c79029a8c3c50a83d3f719cc5c5171e (diff)
sna: Check against last clip box (not past the end of the boxes)
The end BoxPtr actually points to one past the end of the clip boxes, so in order to inspect whether the line is after the clip region, we want to look at the last box, i.e. the box before. We also only want to ignore the clip if we do not intersect at all, otherwise we need to find the start of the clip row. Reported-by: Matti Hämäläinen <ccr@tnsp.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r--src/sna/sna.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 2cf664f0..4fdb541c 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -1196,7 +1196,7 @@ find_clip_box_for_y(const BoxRec *begin, const BoxRec *end, int16_t y)
{
if (begin->y2 > y)
return begin;
- if (end->y1 <= y)
+ if (y > end[-1].y2)
return end;
return __find_clip_box_for_y(begin, end, y);