diff options
author | Dave Airlie <airlied@redhat.com> | 2016-05-23 07:20:50 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-05-23 07:33:03 +1000 |
commit | 62c728f7d84400c19681971855338e3e9e8e80da (patch) | |
tree | 3a293cbe20ecb13b1df2302e2881051abc76730a /src/mesa/main/queryobj.c | |
parent | a7fad12931a62bdd8483b68f7cccbf0ca01bcb89 (diff) | |
download | external_mesa3d-62c728f7d84400c19681971855338e3e9e8e80da.zip external_mesa3d-62c728f7d84400c19681971855338e3e9e8e80da.tar.gz external_mesa3d-62c728f7d84400c19681971855338e3e9e8e80da.tar.bz2 |
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 <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/queryobj.c')
-rw-r--r-- | src/mesa/main/queryobj.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 7a70b59..1fa0279 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: |