[Mesa-dev] [PATCH 1/2] st/glx/xlib: check for null ctx pointer in glXIsDirect()

Brian Paul brianp at vmware.com
Mon May 20 15:20:13 PDT 2013


Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64745
Note: This is a candidate for the stable branches.
---
 src/gallium/state_trackers/glx/xlib/glx_api.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index 88f5886..a66ebc8 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -1369,9 +1369,7 @@ glXDestroyContext( Display *dpy, GLXContext ctx )
 PUBLIC Bool
 glXIsDirect( Display *dpy, GLXContext ctx )
 {
-   GLXContext glxCtx = ctx;
-   (void) ctx;
-   return glxCtx->isDirect;
+   return ctx ? ctx->isDirect : False;
 }
 
 
-- 
1.7.3.4



More information about the mesa-dev mailing list