From: Dave Airlie Date: Sun, 22 May 2016 21:20:50 +0000 (+1000) Subject: mesa/queryobject: return INVALID_VALUE if offset < 0 (v2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62c728f7d84400c19681971855338e3e9e8e80da;p=mesa.git mesa/queryobject: return INVALID_VALUE if offset < 0 (v2) This fixes: GL45-CTS.direct_state_access.queries_errors The ARB_direct_state_access spec agrees. v2: move check down further (Ilia) Reviewed-by: Ilia Mirkin Signed-off-by: Dave Airlie --- diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 7a70b592c47..1fa02795c1c 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -766,6 +766,11 @@ get_query_object(struct gl_context *ctx, const char *func, return; } + if (offset < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(offset is negative)", func); + return; + } + switch (pname) { case GL_QUERY_RESULT: case GL_QUERY_RESULT_NO_WAIT: