diff options
author | Egbert Eich <eich@suse.de> | 2004-07-30 21:10:46 +0000 |
---|---|---|
committer | Egbert Eich <eich@suse.de> | 2004-07-30 21:10:46 +0000 |
commit | 0ba15599466ddb644728c6b68e64e05b1317ac2e (patch) | |
tree | a8ffa0ec4b451b03536e7a0789cfd7d20c5a8911 /hw/xfree86/common | |
parent | bbfe7bed3fe4d9bd089327cd59e6faedb592dabb (diff) |
Adding a colormap index to the InitColormapPrivate() func call. Without it
it was completely useless.
test if colormap with index really exists in the list of installed maps
before using it.
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r-- | hw/xfree86/common/xf86cmap.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index 52ab57f4a..ee682aebb 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -1,4 +1,4 @@ -/* $XdotOrg$ */ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.25 2003/10/17 20:02:12 alanh Exp $ */ /* * Copyright (c) 1998-2001 by The XFree86 Project, Inc. @@ -117,7 +117,7 @@ static int CMapChangeGamma(int, Gamma); static void ComputeGamma(CMapScreenPtr); static Bool CMapAllocateColormapPrivate(ColormapPtr); -static Bool CMapInitDefMap(ColormapPtr); +static Bool CMapInitDefMap(ColormapPtr,int); static void CMapRefreshColors(ColormapPtr, int, int*); static void CMapSetOverscan(ColormapPtr, int, int *); static void CMapReinstallMap(ColormapPtr); @@ -211,7 +211,7 @@ Bool xf86HandleColormaps( /* get the default map */ pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP); - + if(!CMapAllocateColormapPrivate(pDefMap)) { CMapUnwrapScreen(pScreen); return FALSE; @@ -224,7 +224,7 @@ Bool xf86HandleColormaps( } static Bool -CMapInitDefMap(ColormapPtr cmap) +CMapInitDefMap(ColormapPtr cmap, int index) { return TRUE; } @@ -433,7 +433,8 @@ CMapInstallColormap(ColormapPtr pmap) /* Important. We let the lower layers, namely DGA, overwrite the choice of Colormap to install */ - pmap = miInstalledMaps[index]; + if (miInstalledMaps[index]) + pmap = miInstalledMaps[index]; if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && (pmap->pVisual->class == TrueColor) && |