X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fglxext.c;h=5943443100693224a05824ecf11147fad082d37f;hb=28e1d55d6e58594295dcaef480f93a273ee57aa9;hp=459b6c2b07e7e737676b4d0790c0e4d07b20e7dc;hpb=5ebd333c6c8aea0aac301ca2dd56ad6ec8cf8056;p=mesa.git diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 459b6c2b07e..59434431006 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -214,6 +214,8 @@ FreeScreenConfigs(struct glx_display * priv) screens = ScreenCount(priv->dpy); for (i = 0; i < screens; i++) { psc = priv->screens[i]; + if (!psc) + continue; glx_screen_cleanup(psc); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) @@ -712,7 +714,8 @@ static GLboolean LockDisplay(dpy); psc->configs = NULL; - if (atof(priv->serverGLXversion) >= 1.3) { + if (priv->majorVersion > 1 || + (priv->majorVersion == 1 && priv->minorVersion >= 3)) { GetReq(GLXGetFBConfigs, fb_req); fb_req->reqType = priv->majorOpcode; fb_req->glxCode = X_GLXGetFBConfigs; @@ -792,7 +795,7 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) ** First allocate memory for the array of per screen configs. */ screens = ScreenCount(dpy); - priv->screens = malloc(screens * sizeof *priv->screens); + priv->screens = calloc(screens, sizeof *priv->screens); if (!priv->screens) return GL_FALSE;