mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
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 4d9b518ad2)
Nominated-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
8d1874bc1c
commit
0fe3462f88
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue