i965: Fix segfault with ARB_oq CheckQuery when results are already fetched.
authorEric Anholt <eric@anholt.net>
Sat, 29 Aug 2009 20:23:58 +0000 (13:23 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 29 Aug 2009 20:29:38 +0000 (13:29 -0700)
src/mesa/drivers/dri/i965/brw_queryobj.c

index f94aa9d02217afbafeceec82a091fe16665283ab..a195bc32b07d63ec4327644401de5a8a3b2a07a4 100644 (file)
@@ -148,7 +148,7 @@ static void brw_check_query(GLcontext *ctx, struct gl_query_object *q)
 {
    struct brw_query_object *query = (struct brw_query_object *)q;
 
-   if (!drm_intel_bo_busy(query->bo)) {
+   if (query->bo == NULL || !drm_intel_bo_busy(query->bo)) {
       brw_queryobj_get_results(query);
       query->Base.Ready = GL_TRUE;
    }