From: Kristian Høgsberg Date: Fri, 23 Jul 2010 12:32:25 +0000 (-0400) Subject: glx: Fix indirect screen initialization X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5dedd7c3b4425127d8b85b7e8df0ecda4009fd7;p=mesa.git glx: Fix indirect screen initialization https://bugs.freedesktop.org/show_bug.cgi?id=29225 --- diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 97149dff702..324230f5e3e 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -739,12 +739,16 @@ glx_screen_init(__GLXscreenConfigs *psc, } static __GLXscreenConfigs * -createIndirectScreen() +createIndirectScreen(int screen, __GLXdisplayPrivate * priv) { __GLXscreenConfigs *psc; psc = Xmalloc(sizeof *psc); + if (psc == NULL) + return NULL; + memset(psc, 0, sizeof *psc); + glx_screen_init(psc, screen, priv); return psc; } @@ -775,6 +779,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) } for (i = 0; i < screens; i++, psc++) { + psc = NULL; #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (priv->dri2Display) psc = (*priv->dri2Display->createScreen) (i, priv); @@ -782,9 +787,9 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) psc = (*priv->driDisplay->createScreen) (i, priv); if (psc == NULL && priv->driswDisplay) psc = (*priv->driswDisplay->createScreen) (i, priv); +#endif if (psc == NULL) psc = createIndirectScreen (i, priv); -#endif priv->screenConfigs[i] = psc; } SyncHandle();