OSDN Git Service

llvmpipe: Clamp both extremes of triangles to framebuffer size.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 11 Feb 2010 10:58:46 +0000 (10:58 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 11 Feb 2010 10:58:46 +0000 (10:58 +0000)
Fix segmentation fault when triangles crossed the axis.

src/gallium/drivers/llvmpipe/lp_setup_tri.c

index 9e59a66..a8bf540 100644 (file)
@@ -442,8 +442,11 @@ do_triangle_ccw(struct setup_context *setup,
    maxx = maxx / TILE_SIZE;
    maxy = maxy / TILE_SIZE;
 
-   /* Clamp maxx, maxy to framebuffer size
+   /*
+    * Clamp to framebuffer size
     */
+   minx = MAX2(minx, 0);
+   miny = MAX2(miny, 0);
    maxx = MIN2(maxx, scene->tiles_x - 1);
    maxy = MIN2(maxy, scene->tiles_y - 1);