aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/colormap.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/colormap.c')
-rw-r--r--xorg-server/dix/colormap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xorg-server/dix/colormap.c b/xorg-server/dix/colormap.c
index fd2843213..cd2101e4a 100644
--- a/xorg-server/dix/colormap.c
+++ b/xorg-server/dix/colormap.c
@@ -2709,11 +2709,11 @@ static void _colormap_find_resource(pointer value, XID id,
ColormapPtr cmap = value;
int j;
+ if (pScreen != cmap->pScreen)
+ return;
+
j = cmap->pVisual - pScreen->visuals;
- /* 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];
+ cmap->pVisual = &visuals[j];
}
/* something has realloced the visuals, instead of breaking