xf86-video-intel: src/sna/sna_trapezoids.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Mar 12 03:53:05 PDT 2012


 src/sna/sna_trapezoids.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 7ae45584327a10b05f7aee99bcb71e9d990a3e9b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Mar 12 10:49:46 2012 +0000

    sna/trapezoids: Add paranoia to ensure that the span starts within the clip
    
    Reported-by: Clemens Eisserer <linuxhippy at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47226
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 3e2802e..e76f918 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -1538,16 +1538,19 @@ inplace_subrow(struct active_list *active, int8_t *row,
 				xstart = INT_MIN;
 			}
 		} else if (xstart < 0) {
-			grid_scaled_x_t fx;
-			int ix;
-
 			xstart = MAX(edge->x.quo, 0);
-			FAST_SAMPLES_X_TO_INT_FRAC(xstart, ix, fx);
-			if (ix < *min)
-				*min = ix;
+			if (xstart < FAST_SAMPLES_X * width) {
+				grid_scaled_x_t fx;
+				int ix;
 
-			row[ix++] += FAST_SAMPLES_X - fx;
-			row[ix] += fx;
+				FAST_SAMPLES_X_TO_INT_FRAC(xstart, ix, fx);
+				if (ix < *min)
+					*min = ix;
+
+				row[ix++] += FAST_SAMPLES_X - fx;
+				if (ix < width)
+					row[ix] += fx;
+			}
 		}
 
 		if (--edge->height_left) {


More information about the xorg-commit mailing list