summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.com>2016-04-21 15:02:53 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2016-05-05 11:48:23 +0100
commitb4d11f93b971a6100f0d5f8ea63b2494d22418e9 (patch)
tree50a807bd793c6c26706deb6160fc46334e50fcb1
parent3a0118e3a4b763cc0ba23597ba4303c326ed83e4 (diff)
dri2: Check for dummyContext to see if the glx_context is valid
According to the comments in src/glx/glxcurrent.c __glXGetCurrentContext() always returns a valid pointer. If no context is made current, it will contain dummyContext. Thus a test for NULL will always fail. https://bugzilla.opensuse.org/show_bug.cgi?id=962609 Tested-by: Olaf Hering <ohering@suse.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 4d9b518ad2a03232bf8162b05c6504d06c47eb91)
-rw-r--r--src/glx/dri2_glx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 82175a82ad5..c18d8862525 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -520,7 +520,7 @@ dri2GetCurrentContext()
struct glx_context *gc = __glXGetCurrentContext();
struct dri2_context *dri2Ctx = (struct dri2_context *)gc;
- return dri2Ctx ? dri2Ctx->driContext : NULL;
+ return (gc != &dummyContext) ? dri2Ctx->driContext : NULL;
}
/**