[Mesa-dev] [PATCH 02/13] glx: Don't segfault if xcb_glx_is_direct_reply returns NULL

Ian Romanick idr at freedesktop.org
Fri Dec 16 11:55:39 PST 2011


From: Ian Romanick <ian.d.romanick at intel.com>

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glx/glxcmds.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index c8ec9c2..c29bc1c 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -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;
-- 
1.7.6.4



More information about the mesa-dev mailing list