glx: Don't segfault if xcb_glx_is_direct_reply returns NULL
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 7 Dec 2011 01:15:26 +0000 (17:15 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 19 Dec 2011 22:55:30 +0000 (14:55 -0800)
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glx/glxcmds.c

index c8ec9c21fed8d20d3af40b4c0452901cd0d33e64..c29bc1cb67b1e84f0a2e025adf1db0eea2b4cc4e 100644 (file)
@@ -594,7 +594,7 @@ __glXIsDirect(Display * dpy, GLXContextID contextID)
                                                               (c, contextID),
                                                               NULL);
 
-   const Bool is_direct = reply->is_direct ? True : False;
+   const Bool is_direct = (reply != NULL && reply->is_direct) ? True : False;
    free(reply);
 
    return is_direct;