aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-06 17:28:46 +0000
committermarha <marha@users.sourceforge.net>2009-11-06 17:28:46 +0000
commit28bca12756e96e4094693edb35fbc1c255629221 (patch)
treeca7dd7f81798d04d3170368a01054371d50c39db /xorg-server/dix
parent21ce31868b5716bb6824fa47ed151fad8d8b5502 (diff)
downloadvcxsrv-28bca12756e96e4094693edb35fbc1c255629221.tar.gz
vcxsrv-28bca12756e96e4094693edb35fbc1c255629221.tar.bz2
vcxsrv-28bca12756e96e4094693edb35fbc1c255629221.zip
Solved crash because wrong map was adjusted when the number of visual was resized.
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/colormap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xorg-server/dix/colormap.c b/xorg-server/dix/colormap.c
index 48d36f796..fd2843213 100644
--- a/xorg-server/dix/colormap.c
+++ b/xorg-server/dix/colormap.c
@@ -2710,7 +2710,10 @@ static void _colormap_find_resource(pointer value, XID id,
int j;
j = cmap->pVisual - pScreen->visuals;
- cmap->pVisual = &visuals[j];
+ /* Only remap if j is between 0 and the number of available visuals, otherwise the cmap
+ does not correspond to the correct visual. */
+ if (j>=0 && j<pScreen->numVisuals)
+ cmap->pVisual = &visuals[j];
}
/* something has realloced the visuals, instead of breaking