mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-12 12:10:25 +01:00
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.
This commit is contained in:
parent
645e297a00
commit
cbecb8fc8e
1 changed files with 4 additions and 0 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue