xserver/fb fbedgeimp.h,1.1,1.2

Carl Worth <xserver-commit-u7BhqnqprCWvj1b/[email protected]>
Newsgroups gmane.comp.freedesktop.xserver.cvs
Message-ID <[email protected]>
Committed by: cworth

Update of /cvs/xserver/xserver/fb
In directory gabe:/tmp/cvs-serv21522/fb

Modified Files:
	fbedgeimp.h 
Log Message:

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


Index: fbedgeimp.h
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbedgeimp.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fbedgeimp.h	29 Jul 2004 08:10:15 -0000	1.1
+++ fbedgeimp.h	21 Jan 2005 18:40:51 -0000	1.2
@@ -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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.