r5430 dsilvers - in /trunk/netsurf/framebuffer: fb_16bpp_plotters.c fb_32bpp_plotters.c fb_plotters.c

netsurf at semichrome.net netsurf at semichrome.net
Wed Sep 24 12:22:53 BST 2008


Author: dsilvers
Date: Wed Sep 24 06:22:52 2008
New Revision: 5430

URL: http://source.netsurf-browser.org?rev=5430&view=rev
Log:
Fix line plotting and rectangle clipping segfault

Modified:
    trunk/netsurf/framebuffer/fb_16bpp_plotters.c
    trunk/netsurf/framebuffer/fb_32bpp_plotters.c
    trunk/netsurf/framebuffer/fb_plotters.c

Modified: trunk/netsurf/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_16bpp_plotters.c?rev=5430&r1=5429&r2=5430&view=diff
==============================================================================
--- trunk/netsurf/framebuffer/fb_16bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_16bpp_plotters.c Wed Sep 24 06:22:52 2008
@@ -66,7 +66,8 @@
 
         if (y0 == y1) {
                 /* horizontal line special cased */
-                fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1);
+                if (!fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1))
+			return true; /* line outside clipping */
 
                 /*LOG(("horiz: %d, %d, %d, %d, %d, 0x%lx, %d, %d",
 		  x0,y0,x1,y1,width,c,dotted,dashed));*/

Modified: trunk/netsurf/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_32bpp_plotters.c?rev=5430&r1=5429&r2=5430&view=diff
==============================================================================
--- trunk/netsurf/framebuffer/fb_32bpp_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_32bpp_plotters.c Wed Sep 24 06:22:52 2008
@@ -60,7 +60,8 @@
 
         if (y0 == y1) {
                 /* horizontal line special cased */
-                fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1);
+                if (!fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1))
+                        return true; /* line outside clipping */
 
                 pvideo = fb_32bpp_get_xy_loc(x0, y0);
 

Modified: trunk/netsurf/framebuffer/fb_plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/fb_plotters.c?rev=5430&r1=5429&r2=5430&view=diff
==============================================================================
--- trunk/netsurf/framebuffer/fb_plotters.c (original)
+++ trunk/netsurf/framebuffer/fb_plotters.c Wed Sep 24 06:22:52 2008
@@ -61,8 +61,8 @@
 
 	if (*y1 < *y0) SWAP(*y0, *y1);
 
-	region1 = REGION(*x0, *y0, clip->x0, clip->x1, clip->y0, clip->y1);
-	region2 = REGION(*x1, *y1, clip->x0, clip->x1, clip->y0, clip->y1);
+	region1 = REGION(*x0, *y0, clip->x0, clip->x1 - 1, clip->y0, clip->y1 - 1);
+	region2 = REGION(*x1, *y1, clip->x0, clip->x1 - 1, clip->y0, clip->y1 - 1);
 
         /* area lies entirely outside the clipping rectangle */
         if ((region1 | region2) && (region1 & region2))




More information about the netsurf-commits mailing list