glx: Fix glXGetFBConfigFromVisualSGIX
Get list of configs returned by glXChooseFBConfig, return it's first
element, free memory.
Fixes: 4ccd253588 ("glx: Require GLX 1.3")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8273
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21607>
This commit is contained in:
committed by
Marge Bot
parent
5d30d11ccc
commit
944a3af531
+9
-2
@@ -1779,9 +1779,16 @@ glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis)
|
||||
{
|
||||
int attrib_list[] = { GLX_VISUAL_ID, vis->visualid, None };
|
||||
int nconfigs = 0;
|
||||
GLXFBConfig *config_list;
|
||||
GLXFBConfig config;
|
||||
|
||||
return (GLXFBConfigSGIX)
|
||||
glXChooseFBConfig(dpy, vis->screen, attrib_list, &nconfigs);
|
||||
config_list = glXChooseFBConfig(dpy, vis->screen, attrib_list, &nconfigs);
|
||||
if (nconfigs == 0)
|
||||
return NULL;
|
||||
|
||||
config = config_list[0];
|
||||
free(config_list);
|
||||
return (GLXFBConfigSGIX)config;
|
||||
}
|
||||
|
||||
#ifndef GLX_USE_APPLEGL
|
||||
|
||||
Reference in New Issue
Block a user