summaryrefslogtreecommitdiffstats
path: root/src/glx/glxext.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-07-23 08:32:25 -0400
committerKristian Høgsberg <[email protected]>2010-07-23 22:05:53 -0400
commitb5dedd7c3b4425127d8b85b7e8df0ecda4009fd7 (patch)
treee5d23b9de63be55490fc63cde8de6dc13bace7a9 /src/glx/glxext.c
parentc796bb0cc3fde409545bff320540ddf5c029e513 (diff)
glx: Fix indirect screen initialization
https://bugs.freedesktop.org/show_bug.cgi?id=29225
Diffstat (limited to 'src/glx/glxext.c')
-rw-r--r--src/glx/glxext.c9
1 files 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();