glx: Handle a null reply in QueryVersion.
authorStéphane Marchesin <marcheu@chromium.org>
Fri, 25 May 2012 00:58:53 +0000 (17:58 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Tue, 12 Jun 2012 21:42:22 +0000 (14:42 -0700)
Works around crashes when X connections break.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
NOTE: This is a candidate for the 8.0 branch.

src/glx/glxext.c

index 12fff22399d762fa8498bbd8f1ac3d106dddf4e2..a4e76c1c3985105ae52b92c4fda5cf5cd63ddcf7 100644 (file)
@@ -293,6 +293,9 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
                                                                        GLX_MINOR_VERSION),
                                                                       NULL);
 
+   if (!reply)
+     return GL_FALSE;
+
    if (reply->major_version != GLX_MAJOR_VERSION) {
       free(reply);
       return GL_FALSE;