llvmpipe: Clamp both extremes of triangles to framebuffer size.

Fix segmentation fault when triangles crossed the axis.
This commit is contained in:
José Fonseca 2010-02-11 10:58:46 +00:00
parent 128d93a009
commit 764c172aa9
1 changed files with 4 additions and 1 deletions

View 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);