]> git.pld-linux.org Git - packages/xorg-xserver-Xdmx.git/blob - xorg-xserver-Xdmx-fix.patch
- applied fix from https://lists.x.org/archives/xorg-devel/2017-June/053919.html
[packages/xorg-xserver-Xdmx.git] / xorg-xserver-Xdmx-fix.patch
1 [PATCH xserver 05/12] glxproxy: Fix __glXActiveScreens allocation
2
3 Apparently this has been broken for about ten years, eesh. We were never
4 allocating any storage for this array, so the first attempt at using GLX
5 with Xdmx would crash the server.
6
7 Promote it to an array and use __glXNumActiveScreens to detect whether
8 GLX is actually enabled.
9
10 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34851
11 Signed-off-by: Adam Jackson <ajax at redhat.com>
12 ---
13  hw/dmx/glxProxy/glxscreens.c | 2 +-
14  hw/dmx/glxProxy/glxserver.h  | 2 +-
15  hw/dmx/glxProxy/glxvisuals.c | 4 ++--
16  3 files changed, 4 insertions(+), 4 deletions(-)
17
18 diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
19 index 508e67ed4..8c5f08beb 100644
20 --- a/hw/dmx/glxProxy/glxscreens.c
21 +++ b/hw/dmx/glxProxy/glxscreens.c
22 @@ -45,7 +45,7 @@
23  #include "panoramiXsrv.h"
24  #endif
25  
26 -__GLXscreenInfo *__glXActiveScreens;
27 +__GLXscreenInfo __glXActiveScreens[MAXSCREENS];
28  GLint __glXNumActiveScreens;
29  
30  __GLXFBConfig **__glXFBConfigs;
31 diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
32 index 7aa5ad2f2..f708f86ee 100644
33 --- a/hw/dmx/glxProxy/glxserver.h
34 +++ b/hw/dmx/glxProxy/glxserver.h
35 @@ -73,7 +73,7 @@ typedef struct __GLXcontextRec *GLXContext;
36  */
37  typedef struct __GLXclientStateRec __GLXclientState;
38  
39 -extern __GLXscreenInfo *__glXActiveScreens;
40 +extern __GLXscreenInfo __glXActiveScreens[MAXSCREENS];
41  extern GLint __glXNumActiveScreens;
42  
43  /************************************************************************/
44 diff --git a/hw/dmx/glxProxy/glxvisuals.c b/hw/dmx/glxProxy/glxvisuals.c
45 index 3fca04f0d..9bde29afd 100644
46 --- a/hw/dmx/glxProxy/glxvisuals.c
47 +++ b/hw/dmx/glxProxy/glxvisuals.c
48 @@ -105,7 +105,7 @@ glxMatchVisualInConfigList(ScreenPtr pScreen, VisualPtr pVisual,
49      int i;
50  
51      /* check that the glx extension has been initialized */
52 -    if (!__glXActiveScreens)
53 +    if (!__glXNumActiveScreens)
54          return 0;
55  
56      pGlxScreen = &__glXActiveScreens[pScreen->myNum];
57 @@ -135,7 +135,7 @@ glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen)
58      VisualID vid;
59  
60      /* check that the glx extension has been initialized */
61 -    if (!__glXActiveScreens)
62 +    if (!__glXNumActiveScreens)
63          return NULL;
64  
65      pGlxScreen2 = &__glXActiveScreens[pMatchScreen->myNum];
66 -- 
67 2.13.0
This page took 0.046522 seconds and 3 git commands to generate.