diff options
author | Egbert Eich <[email protected]> | 2016-04-21 15:02:53 +0200 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-05-05 13:59:32 +0100 |
commit | 0fe3462f88e861ce5d42fb84387612f80b23f530 (patch) | |
tree | 60ed0d0a0009de4dd8f20f411fb62152e48d5260 /src/glx | |
parent | 8d1874bc1cd2d2e479cbefb35f4d22d9dd378178 (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 <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
(cherry picked from commit 4d9b518ad2a03232bf8162b05c6504d06c47eb91)
Nominated-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/dri2_glx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 77103492a4f..7288266444d 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; } /** |