aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-30 15:40:11 +0200
committermarha <marha@users.sourceforge.net>2013-08-30 15:40:11 +0200
commit22bc825e9931f718cc0564aa55915961abaffce4 (patch)
treef53ea31eb5368d3f60860d3e8911fa83a7fd851a /mesalib/src/mesa/main/api_validate.c
parentac46cfda36d6dbe8d5c092124a66ffe3f2bad15f (diff)
parent5ebbc3a366287b631775ed3e17537580d380db8a (diff)
downloadvcxsrv-22bc825e9931f718cc0564aa55915961abaffce4.tar.gz
vcxsrv-22bc825e9931f718cc0564aa55915961abaffce4.tar.bz2
vcxsrv-22bc825e9931f718cc0564aa55915961abaffce4.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig mesa xserver xkeyboard-config xkbcomp git update 30 aug 2013
Diffstat (limited to 'mesalib/src/mesa/main/api_validate.c')
-rw-r--r--mesalib/src/mesa/main/api_validate.c51
1 files changed, 30 insertions, 21 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index 243bb89d1..002992186 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/src/mesa/main/api_validate.c
@@ -402,9 +402,8 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
return GL_FALSE;
}
- if (count <= 0) {
- if (count < 0)
- _mesa_error(ctx, GL_INVALID_VALUE, "glDrawElements(count)" );
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDrawElements(count)" );
return GL_FALSE;
}
@@ -436,6 +435,9 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
if (!check_index_bounds(ctx, count, type, indices, basevertex))
return GL_FALSE;
+ if (count == 0)
+ return GL_FALSE;
+
return GL_TRUE;
}
@@ -456,10 +458,9 @@ _mesa_validate_MultiDrawElements(struct gl_context *ctx,
FLUSH_CURRENT(ctx, 0);
for (i = 0; i < primcount; i++) {
- if (count[i] <= 0) {
- if (count[i] < 0)
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glMultiDrawElements(count)" );
+ if (count[i] < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glMultiDrawElements(count)" );
return GL_FALSE;
}
}
@@ -531,9 +532,8 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
return GL_FALSE;
}
- if (count <= 0) {
- if (count < 0)
- _mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(count)" );
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(count)" );
return GL_FALSE;
}
@@ -570,6 +570,9 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
if (!check_index_bounds(ctx, count, type, indices, basevertex))
return GL_FALSE;
+ if (count == 0)
+ return GL_FALSE;
+
return GL_TRUE;
}
@@ -587,9 +590,8 @@ _mesa_validate_DrawArrays(struct gl_context *ctx,
= ctx->TransformFeedback.CurrentObject;
FLUSH_CURRENT(ctx, 0);
- if (count <= 0) {
- if (count < 0)
- _mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" );
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" );
return GL_FALSE;
}
@@ -628,6 +630,9 @@ _mesa_validate_DrawArrays(struct gl_context *ctx,
xfb_obj->GlesRemainingPrims -= prim_count;
}
+ if (count == 0)
+ return GL_FALSE;
+
return GL_TRUE;
}
@@ -640,10 +645,9 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
= ctx->TransformFeedback.CurrentObject;
FLUSH_CURRENT(ctx, 0);
- if (count <= 0) {
- if (count < 0)
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glDrawArraysInstanced(count=%d)", count);
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glDrawArraysInstanced(count=%d)", count);
return GL_FALSE;
}
@@ -696,6 +700,9 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
xfb_obj->GlesRemainingPrims -= prim_count;
}
+ if (count == 0)
+ return GL_FALSE;
+
return GL_TRUE;
}
@@ -721,10 +728,9 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
return GL_FALSE;
}
- if (count <= 0) {
- if (count < 0)
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glDrawElementsInstanced(count=%d)", count);
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glDrawElementsInstanced(count=%d)", count);
return GL_FALSE;
}
@@ -761,6 +767,9 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
return GL_FALSE;
}
+ if (count == 0)
+ return GL_FALSE;
+
if (!check_index_bounds(ctx, count, type, indices, basevertex))
return GL_FALSE;