summaryrefslogtreecommitdiffstats
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-12-07 11:37:01 -0800
committerIan Romanick <[email protected]>2011-12-19 14:55:30 -0800
commit3b9b42250ca9f0da6e979afc047d1c8524466076 (patch)
tree2c0156c97035b09df6733acdf3d7692327cc9654 /src/glx/glxcmds.c
parent5a849e864ea2db3b705ba301089ee2ec1fe78aa1 (diff)
glx: Don't segfault if glXGetContextIDEXT is pased a NULL context
Fixes the piglit test glx-get-context-id. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 6ef7b926835..f2c1884b8a5 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -1563,7 +1563,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