[Mesa-dev] [PATCH 04/13] glx: Don't segfault if glXGetContextIDEXT is pased a NULL context

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


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

Fixes the piglit test glx-get-context-id.

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 345b6dc..c799b36 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -1559,7 +1559,7 @@ _X_EXPORT GLXContextID glXGetContextIDEXT(const GLXContext ctx_user)
 {
    struct glx_context *ctx = (struct glx_context *) ctx_user;
 
-   return ctx->xid;
+   return (ctx == NULL) ? None : ctx->xid;
 }
 
 _X_EXPORT
-- 
1.7.6.4



More information about the mesa-dev mailing list