[cairo-commit] libpixman/src fbedgeimp.h,1.1,1.2

Carl Worth commit at pdx.freedesktop.org
Fri Jan 21 10:38:44 PST 2005


Committed by: cworth

Update of /cvs/cairo/libpixman/src
In directory gabe:/tmp/cvs-serv21282/src

Modified Files:
	fbedgeimp.h 
Log Message:

        * src/fbedgeimp.h (rasterizeEdges): Avoid buffer ovverrun when
        trapezoid's right edge is on a pixel boundary.


Index: fbedgeimp.h
===================================================================
RCS file: /cvs/cairo/libpixman/src/fbedgeimp.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fbedgeimp.h	18 Jan 2005 19:54:23 -0000	1.1
+++ fbedgeimp.h	21 Jan 2005 18:38:42 -0000	1.2
@@ -56,7 +56,7 @@
 	if (rx > lx)
 	{
 
-	    /* Find pixel bounds for span */
+	    /* Find pixel bounds for span. */
 	    lxi = xFixedToInt (lx);
 	    rxi = xFixedToInt (rx);
 
@@ -104,7 +104,11 @@
 			AddAlpha (N_X_FRAC(N_BITS));
 			StepAlpha;
 		    }
-		    AddAlpha (rxs);
+		    /* Do not add in a 0 alpha here. This check is
+		     * necessary to avoid a buffer overrun, (when rx
+		     * is exactly on a pixel boundary). */
+		    if (rxs)
+			AddAlpha (rxs);
 		}
 	    }
 #endif




More information about the cairo-commit mailing list