From 28bca12756e96e4094693edb35fbc1c255629221 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 6 Nov 2009 17:28:46 +0000 Subject: Solved crash because wrong map was adjusted when the number of visual was resized. --- xorg-server/dix/colormap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xorg-server/dix/colormap.c') 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 && jnumVisuals) + cmap->pVisual = &visuals[j]; } /* something has realloced the visuals, instead of breaking -- cgit v1.2.3