mesa: Add missing error check for first < 0 in glDrawArraysInstanced().
authorEric Anholt <eric@anholt.net>
Tue, 28 Feb 2012 21:33:53 +0000 (13:33 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 29 Feb 2012 21:21:12 +0000 (13:21 -0800)
Fixes piglit GL_ARB_draw_instanced/negative-arrays-first-negative.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/api_validate.c

index b10d8cd053c9b568260ac0e9450479d6da6ce606..4e94f47e3286955496da5082131aec18452b4ab1 100644 (file)
@@ -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);