check for count==0 in _mesa_validate_DrawArrays()
authorBrian <brian.paul@tungstengraphics.com>
Wed, 31 Oct 2007 15:38:51 +0000 (09:38 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 31 Oct 2007 15:57:47 +0000 (09:57 -0600)
src/mesa/main/api_validate.c

index e2eebccd4778f264299d6c9208752ed7dd28b391..74b0912bef6c69a9cc11e5ad069c4c38354ed81f 100644 (file)
@@ -247,8 +247,9 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
 {
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
 
-   if (count < 0) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" );
+   if (count <= 0) {
+      if (count < 0)
+         _mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" );
       return GL_FALSE;
    }