From 05471828dc8dd4a184d4467b66e9c08449d1d4c9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 15 Apr 2009 08:01:01 -0600 Subject: [PATCH] glx: added null pointer check in glXGetFBConfigs() Fixes segfault seen with glxinfo with NVIDIA OpenGL. --- src/glx/x11/glxcmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index e5c0db4c968..b9e0706d312 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -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) ) { -- 2.30.2