diff options
author | Eric Anholt <[email protected]> | 2012-02-28 13:33:53 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-02-29 13:21:12 -0800 |
commit | 767ba60831657a684e3852c398a0d13d1201158f (patch) | |
tree | c5f578dea4e289ecbfe221463ad50f5b4e7917bb /src/mesa/main | |
parent | 871518dbf8266fe91d09e3368fe2bc90603cd3b1 (diff) |
mesa: Add missing error check for first < 0 in glDrawArraysInstanced().
Fixes piglit GL_ARB_draw_instanced/negative-arrays-first-negative.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/api_validate.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index b10d8cd053c..4e94f47e328 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -383,6 +383,12 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi return GL_FALSE; } + if (first < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glDrawArraysInstanced(start=%d)", first); + return GL_FALSE; + } + if (!_mesa_valid_prim_mode(ctx, mode)) { _mesa_error(ctx, GL_INVALID_ENUM, "glDrawArraysInstanced(mode=0x%x)", mode); |