diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 8df68e6d7..148a4075d 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -123,7 +123,8 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config, } /* FIXME: What exactly should we check here... */ - if (pVisual->class != glxConvertToXVisualType(config->visualType) || + if (pVisual == NULL || + pVisual->class != glxConvertToXVisualType(config->visualType) || !(config->drawableType & GLX_WINDOW_BIT)) { client->errorValue = pDraw->id; *err = BadMatch;