[Mesa-dev] [PATCH 3/4] mesa: Refuse to EndQuery with a mismatched query target.

Eric Anholt eric at anholt.net
Fri Oct 19 11:53:48 PDT 2012


---
 src/mesa/main/queryobj.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index ac03649..d2f064e 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -374,6 +374,15 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index)
 
    /* XXX should probably refcount query objects */
    q = *bindpt;
+
+   if (q && q->Target != target) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glEndQuery(target=%s with active query of target %s)",
+                  _mesa_lookup_enum_by_nr(target),
+                  _mesa_lookup_enum_by_nr(q->Target));
+      return;
+   }
+
    *bindpt = NULL;
 
    if (!q || !q->Active) {
-- 
1.7.10.4



More information about the mesa-dev mailing list