summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-06-23 00:20:11 +0200
committerMarek Olšák <[email protected]>2010-06-23 00:20:11 +0200
commitd84bf6d44dcac8cf8babb6ddce05cbc8f76db24c (patch)
tree1e49fea35aeaf1fc37f21c7d4ecdac8708caf32d /src/gallium/drivers/r300
parente130f524a93f6fc62af81549269d306e1ad17d4f (diff)
r300g: index buffer range checking
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_render.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 4afd124c0eb..0fd05b51ac1 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -508,6 +508,12 @@ static void r300_draw_range_elements(struct pipe_context* pipe,
return;
}
+ /* Index buffer range checking. */
+ if ((start + count) * indexSize > indexBuffer->width0) {
+ fprintf(stderr, "r300: Invalid index buffer range. Skipping rendering.\n");
+ return;
+ }
+
/* Set up fallback for incompatible vertex layout if needed. */
if (r300->incompatible_vb_layout || r300->velems->incompatible_layout) {
r300_begin_vertex_translate(r300);