From 719626ef7918d5cd69d13f983b8b615aefe215d6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 29 Oct 2011 10:26:08 +0100 Subject: [PATCH] sna: Increment clip box when short-circuiting the iteration Reported-by: nkalkhof@web.de Bugzilla: https://bugs.freedesktop.org/show_bug.cgi Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index fead5a19..3c1a65e6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1968,10 +1968,12 @@ no_damage_clipped: if (y + 1 <= c->y1) break; - if (X2 <= c->x1) - continue; if (X1 >= c->x2) break; + if (X2 <= c->x1) { + c++; + continue; + } b->x1 = c->x1; b->x2 = c->x2; @@ -1981,6 +1983,8 @@ no_damage_clipped: b->x1 = X1; if (b->x2 > X2) b->x2 = X2; + if (b->x2 <= b->x1) + continue; b->x1 += dx; b->x2 += dx; @@ -2073,10 +2077,12 @@ damage_clipped: if (y + 1 <= c->y1) break; - if (X2 <= c->x1) - continue; if (X1 >= c->x2) break; + if (X2 <= c->x1) { + c++; + continue; + } b->x1 = c->x1; b->x2 = c->x2; @@ -2086,6 +2092,8 @@ damage_clipped: b->x1 = X1; if (b->x2 > X2) b->x2 = X2; + if (b->x2 <= b->x1) + continue; b->x1 += dx; b->x2 += dx;