summaryrefslogtreecommitdiff
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2011-12-07 11:37:01 -0800
committerIan Romanick <ian.d.romanick@intel.com>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 <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
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 6ef7b92683..f2c1884b8a 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