projects
/
profile
/
ivi
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e130f52
)
r300g: index buffer range checking
author
Marek Olšák
<maraeo@gmail.com>
Tue, 22 Jun 2010 22:20:11 +0000
(
00:20
+0200)
committer
Marek Olšák
<maraeo@gmail.com>
Tue, 22 Jun 2010 22:20:11 +0000
(
00:20
+0200)
src/gallium/drivers/r300/r300_render.c
patch
|
blob
|
history
diff --git
a/src/gallium/drivers/r300/r300_render.c
b/src/gallium/drivers/r300/r300_render.c
index
4afd124
..
0fd05b5
100644
(file)
--- 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);