diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 1c88c2a06..a8bfe30ef 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -133,7 +133,8 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config, BUG_RETURN_VAL(!pVisual, FALSE); /* 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;