Browse Source

vbo: in glDraw[Range]Element() code, check for out of bounds indexes

No-op the bad drawing command rather than go out of bounds and render
garbage.  Print a warning to alert the developer to the bad drawing call.
tags/mesa_7_6_rc1
Brian Paul 17 years ago
parent
commit
f37cccde3c
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/mesa/vbo/vbo_exec_array.c

+ 7
- 0
src/mesa/vbo/vbo_exec_array.c View File

@@ -352,6 +352,13 @@ vbo_exec_DrawRangeElements(GLenum mode,
if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, type, indices ))
return;

if (end >= ctx->Array._MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
_mesa_warning(ctx, "glDraw[Range]Elements() index=%u is "
"out of bounds (max=%u)", end, ctx->Array._MaxElement);
return;
}

FLUSH_CURRENT( ctx, 0 );

if (ctx->NewState)

Loading…
Cancel
Save