mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
mesa: check_index_bounds off-by-one fix
in check_index_bounds the comparison needs to be "greater equal" since
contrary to the name _MaxElement is the count of the array (this matches
similar code in vbo_exec_DrawRangeElementsBaseVertex).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1f4a853b1e)
This commit is contained in:
parent
d7b1a7bfb1
commit
78b66adc1a
1 changed files with 1 additions and 1 deletions
|
|
@ -187,7 +187,7 @@ check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type,
|
|||
vbo_get_minmax_index(ctx, &prim, &ib, &min, &max);
|
||||
|
||||
if ((int)(min + basevertex) < 0 ||
|
||||
max + basevertex > ctx->Array.ArrayObj->_MaxElement) {
|
||||
max + basevertex >= ctx->Array.ArrayObj->_MaxElement) {
|
||||
/* the max element is out of bounds of one or more enabled arrays */
|
||||
_mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)",
|
||||
max, ctx->Array.ArrayObj->_MaxElement);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue