aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-02-22 14:00:29 +0100
committerNicolai Hähnle <[email protected]>2017-03-22 12:12:29 +0100
commitc11dcfb5e9b051b9036949b3e40a9dc15138bd97 (patch)
tree848b95a9ab1fdc56f1c56a2a9f327aac9f6708ee /src/mesa/main/api_validate.h
parentc2dfff280ba7d0857e350581496daa17cccacb84 (diff)
mesa/main: fix MultiDrawElements[BaseVertex] validation of primcount
primcount must be a GLsizei as in the signature for MultiDrawElements or bad things can happen. Furthermore, an error should be flagged when primcount is negative. Curiously, this code used to work somewhat correctly even when primcount was negative, because the loop that checks count[i] would iterate out of bounds and almost certainly hit a negative value at some point. Found by an ASAN error in GL45-CTS.gtf32.GL3Tests.draw_elements_base_vertex.draw_elements_base_vertex_primcount Note that the OpenGL spec seems to have s/primcount/drawcount/ at some point, and the code still reflects the old language. v2: provide the correct spec quotes (pointed out by Ian) Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/api_validate.h')
-rw-r--r--src/mesa/main/api_validate.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h
index e94f02e4ba5..de520c98dcb 100644
--- a/src/mesa/main/api_validate.h
+++ b/src/mesa/main/api_validate.h
@@ -57,7 +57,7 @@ extern GLboolean
_mesa_validate_MultiDrawElements(struct gl_context *ctx,
GLenum mode, const GLsizei *count,
GLenum type, const GLvoid * const *indices,
- GLuint primcount);
+ GLsizei primcount);
extern GLboolean
_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,