glx: added null pointer check in glXGetFBConfigs()

Fixes segfault seen with glxinfo with NVIDIA OpenGL.
This commit is contained in:
Brian Paul 2009-04-15 08:01:01 -06:00
parent 0115a4f8f1
commit 05471828dc

View file

@ -1702,7 +1702,8 @@ PUBLIC GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements)
int i;
*nelements = 0;
if ( (priv->screenConfigs != NULL)
if ( priv
&& (priv->screenConfigs != NULL)
&& (screen >= 0) && (screen <= ScreenCount(dpy))
&& (priv->screenConfigs[screen].configs != NULL)
&& (priv->screenConfigs[screen].configs->fbconfigID != GLX_DONT_CARE) ) {