From: Brian Paul Date: Tue, 26 Jan 2010 19:49:44 +0000 (-0700) Subject: vbo: if 'end' is out of bounds, clamp it X-Git-Tag: 062012170305~12852^2~1452^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbecb8fc8e85cfafed7fd8fd0e2dd1143efcf62b;p=profile%2Fivi%2Fmesa.git 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. --- diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index f455382..bd2fccd 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}"