From 0256edd709d976198d5354fdd88143d8da9e51d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Marchesin?= Date: Thu, 24 May 2012 17:58:53 -0700 Subject: [PATCH] glx: Handle a null reply in QueryVersion. Works around crashes when X connections break. Reviewed-by: Ian Romanick NOTE: This is a candidate for the 8.0 branch. --- src/glx/glxext.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 12fff22399d..a4e76c1c398 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -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; -- 2.30.2