summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-02-11 10:58:46 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-02-11 10:58:46 +0000
commit764c172aa96d48e1cf18b903661064c1ef8df1b5 (patch)
tree29e9ab75b12397d5e8070a6a01cfcb871b7fc84d /src/gallium/drivers
parent128d93a009c493c65f0fa5d220fac3098a54fa14 (diff)
llvmpipe: Clamp both extremes of triangles to framebuffer size.
Fix segmentation fault when triangles crossed the axis.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_tri.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 9e59a6602c..a8bf540803 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -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);