From deb4a63a867d58b400a2b8d45ea5db5a54d71fac Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 28 Nov 2003 20:30:36 +0000 Subject: [PATCH] if id==0 in glGetQueryObject, raise GL_INVALID_OPERATION --- src/mesa/main/occlude.c | 15 +++++++++------ 1 file 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; -- 2.30.2