Skip to content
Snippets Groups Projects
Commit 0fe3462f authored by Egbert Eich's avatar Egbert Eich Committed by Emil Velikov
Browse files

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: default avatarOlaf Hering <ohering@suse.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 4d9b518a)
Nominated-by: default avatarEmil Velikov <emil.velikov@collabora.com>
parent 8d1874bc
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment