From b5dedd7c3b4425127d8b85b7e8df0ecda4009fd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 23 Jul 2010 08:32:25 -0400 Subject: [PATCH] glx: Fix indirect screen initialization https://bugs.freedesktop.org/show_bug.cgi?id=29225 --- src/glx/glxext.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); -- 2.30.2