summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-03-27 15:42:53 -0400
committerAdam Jackson <ajax@redhat.com>2017-06-16 15:38:17 -0400
commitcc113b40d683e9fa594769c556d299d63b816236 (patch)
treec3c4ebc571e5c515a6a3561fd2ea0fa86e9e1de7
parent8eb32a4e7d83e5fa3c442d37834790c38ed259ac (diff)
glxproxy: Fix __glXActiveScreens allocation
Apparently this has been broken for about ten years, eesh. We were never allocating any storage for this array, so the first attempt at using GLX with Xdmx would crash the server. Promote it to an array and use __glXNumActiveScreens to detect whether GLX is actually enabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34851 Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--hw/dmx/glxProxy/glxscreens.c2
-rw-r--r--hw/dmx/glxProxy/glxserver.h2
-rw-r--r--hw/dmx/glxProxy/glxvisuals.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
index 508e67ed4..8c5f08beb 100644
--- a/hw/dmx/glxProxy/glxscreens.c
+++ b/hw/dmx/glxProxy/glxscreens.c
@@ -45,7 +45,7 @@
#include "panoramiXsrv.h"
#endif
-__GLXscreenInfo *__glXActiveScreens;
+__GLXscreenInfo __glXActiveScreens[MAXSCREENS];
GLint __glXNumActiveScreens;
__GLXFBConfig **__glXFBConfigs;
diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
index 7aa5ad2f2..f708f86ee 100644
--- a/hw/dmx/glxProxy/glxserver.h
+++ b/hw/dmx/glxProxy/glxserver.h
@@ -73,7 +73,7 @@ typedef struct __GLXcontextRec *GLXContext;
*/
typedef struct __GLXclientStateRec __GLXclientState;
-extern __GLXscreenInfo *__glXActiveScreens;
+extern __GLXscreenInfo __glXActiveScreens[MAXSCREENS];
extern GLint __glXNumActiveScreens;
/************************************************************************/
diff --git a/hw/dmx/glxProxy/glxvisuals.c b/hw/dmx/glxProxy/glxvisuals.c
index 3fca04f0d..9bde29afd 100644
--- a/hw/dmx/glxProxy/glxvisuals.c
+++ b/hw/dmx/glxProxy/glxvisuals.c
@@ -105,7 +105,7 @@ glxMatchVisualInConfigList(ScreenPtr pScreen, VisualPtr pVisual,
int i;
/* check that the glx extension has been initialized */
- if (!__glXActiveScreens)
+ if (!__glXNumActiveScreens)
return 0;
pGlxScreen = &__glXActiveScreens[pScreen->myNum];
@@ -135,7 +135,7 @@ glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen)
VisualID vid;
/* check that the glx extension has been initialized */
- if (!__glXActiveScreens)
+ if (!__glXNumActiveScreens)
return NULL;
pGlxScreen2 = &__glXActiveScreens[pMatchScreen->myNum];