Bug 1292443 a=dveditz
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 20 Oct 2016 12:25:28 -0700
changeset 350752 d4fe6876afeb14bfa005e24b9e47260d9a2b4e1c
parent 350751 0cf671e08f5c41c82aa9930dd5084699683d0901
child 350753 2bb6dc758711c00d84246d74b57e5aa6cae4b447
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdveditz
bugs1292443
milestone50.0
Bug 1292443 a=dveditz
gfx/cairo/libpixman/src/pixman-edge-imp.h
--- a/gfx/cairo/libpixman/src/pixman-edge-imp.h
+++ b/gfx/cairo/libpixman/src/pixman-edge-imp.h
@@ -50,18 +50,19 @@ RASTERIZE_EDGES (pixman_image_t  *image,
 #if N_BITS == 1
 	/* For the non-antialiased case, round the coordinates up, in effect
 	 * sampling just slightly to the left of the pixel. This is so that
 	 * when the sample point lies exactly on the line, we round towards
 	 * north-west.
 	 *
 	 * (The AA case does a similar  adjustment in RENDER_SAMPLES_X)
 	 */
-	lx += X_FRAC_FIRST(1) - pixman_fixed_e;
-	rx += X_FRAC_FIRST(1) - pixman_fixed_e;
+        /* we cast to unsigned to get defined behaviour for overflow */
+	lx = (unsigned)lx + X_FRAC_FIRST(1) - pixman_fixed_e;
+	rx = (unsigned)rx + X_FRAC_FIRST(1) - pixman_fixed_e;
 #endif
 	/* clip X */
 	if (lx < 0)
 	    lx = 0;
 	if (pixman_fixed_to_int (rx) >= width)
 #if N_BITS == 1
 	    rx = pixman_int_to_fixed (width);
 #else