[Mesa-dev] [PATCH 2/6] glx: Handle a null reply in QueryVersion.

Stéphane Marchesin marcheu at chromium.org
Thu May 24 18:29:44 PDT 2012


Works around crashes when X connections break.
---
 src/glx/glxext.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 12fff22..a4e76c1 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;
-- 
1.7.5.3.367.ga9930



More information about the mesa-dev mailing list