glx: added null pointer check in glXGetFBConfigs()
authorBrian Paul <brianp@vmware.com>
Wed, 15 Apr 2009 14:01:01 +0000 (08:01 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 15 Apr 2009 14:01:45 +0000 (08:01 -0600)
Fixes segfault seen with glxinfo with NVIDIA OpenGL.

src/glx/x11/glxcmds.c

index e5c0db4c968dec65a98713f214521472dd6c799f..b9e0706d312c66717dac50e808d0858f6fce7b49 100644 (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) ) {