aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/shm.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
committermarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
commit3fce787ffe938bb3e959ff0b3ec231e54d086c76 (patch)
tree198f537b43a34301bf781c67193c572f6743f925 /xorg-server/Xext/shm.c
parent236c69d6034b152598ce35abaf3559b0eaa89c12 (diff)
parent578938f1cdd5a06dd6fa28167d575ec980322a5d (diff)
downloadvcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.gz
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.bz2
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/Xext/shm.c')
-rw-r--r--xorg-server/Xext/shm.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/xorg-server/Xext/shm.c b/xorg-server/Xext/shm.c
index 10af0b286..6c354a103 100644
--- a/xorg-server/Xext/shm.c
+++ b/xorg-server/Xext/shm.c
@@ -143,7 +143,6 @@ int BadShmSegCode;
RESTYPE ShmSegType;
static ShmDescPtr Shmsegs;
static Bool sharedPixmaps;
-static DrawablePtr *drawables;
static int shmScrPrivateKeyIndex;
static DevPrivateKey shmScrPrivateKey = &shmScrPrivateKeyIndex;
static int shmPixmapPrivateIndex;
@@ -261,13 +260,6 @@ ShmExtensionInit(INITARGS)
}
#endif
- drawables = xcalloc(screenInfo.numScreens, sizeof(DrawablePtr));
- if (!drawables)
- {
- ErrorF("MIT-SHM extension disabled: no memory for per-screen drawables\n");
- return;
- }
-
sharedPixmaps = xFalse;
{
sharedPixmaps = xTrue;
@@ -637,6 +629,7 @@ static int
ProcPanoramiXShmGetImage(ClientPtr client)
{
PanoramiXRes *draw;
+ DrawablePtr *drawables;
DrawablePtr pDraw;
xShmGetImageReply xgi;
ShmDescPtr shmdesc;
@@ -697,12 +690,19 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return(BadMatch);
}
+ drawables = xcalloc(PanoramiXNumScreens, sizeof(DrawablePtr));
+ if(!drawables)
+ return(BadAlloc);
+
drawables[0] = pDraw;
for(i = 1; i < PanoramiXNumScreens; i++) {
rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
DixReadAccess);
if (rc != Success)
+ {
+ xfree(drawables);
return rc;
+ }
}
xgi.visual = wVisual(((WindowPtr)pDraw));
@@ -741,6 +741,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
}
}
}
+ xfree(drawables);
if (client->swapped) {
int n;