summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-01-26 12:49:44 -0700
committerBrian Paul <[email protected]>2010-01-26 12:49:48 -0700
commitcbecb8fc8e85cfafed7fd8fd0e2dd1143efcf62b (patch)
treebbbd69b7c998717d0e75ec11b8972258b11c2abf /src
parent645e297a0019eb2f7513bd801ffdaac03187f29f (diff)
vbo: if 'end' is out of bounds, clamp it
If we determine that the 'end' parameter to glDrawElements() is out of bounds, clamp it to the max legal index value.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/vbo/vbo_exec_array.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index f4553825921..bd2fccdba14 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -748,6 +748,10 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
*/
}
#endif
+
+ /* Set 'end' to the max possible legal value */
+ assert(ctx->Array.ArrayObj->_MaxElement >= 1);
+ end = ctx->Array.ArrayObj->_MaxElement - 1;
}
else if (0) {
_mesa_printf("glDraw[Range]Elements{,BaseVertex}"