diff options
author | Brian Paul <[email protected]> | 2003-11-28 20:30:36 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-11-28 20:30:36 +0000 |
commit | deb4a63a867d58b400a2b8d45ea5db5a54d71fac (patch) | |
tree | bffed569b2039c1571893d28cca3be12f2168cca /src | |
parent | c99e2dd1d38db25d393a33870778a8eeb1a23020 (diff) |
if id==0 in glGetQueryObject, raise GL_INVALID_OPERATION
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/occlude.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c index 73a29cc9392..2a3f8a00b9d 100644 --- a/src/mesa/main/occlude.c +++ b/src/mesa/main/occlude.c @@ -274,11 +274,13 @@ void GLAPIENTRY _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); - struct occlusion_query *q; + struct occlusion_query *q = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); - q = (struct occlusion_query *) - _mesa_HashLookup(ctx->Occlusion.QueryObjects, id); + if (id) + q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, id); + if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectivARB"); return; @@ -303,11 +305,12 @@ void GLAPIENTRY _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) { GET_CURRENT_CONTEXT(ctx); - struct occlusion_query *q; + struct occlusion_query *q = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); - q = (struct occlusion_query *) - _mesa_HashLookup(ctx->Occlusion.QueryObjects, id); + if (id) + q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, id); if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectuivARB"); return; |