From 3b9b42250ca9f0da6e979afc047d1c8524466076 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 7 Dec 2011 11:37:01 -0800 Subject: [PATCH] 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 Reviewed-by: Adam Jackson Reviewed-by: Eric Anholt --- src/glx/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.30.2