From 77d0101f781996504775206433d5d490237fb429 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 29 Mar 2007 22:29:17 +0100 Subject: [PATCH] Set the pixel value to zero before commencing FindColor. ==31523== Conditional jump or move depends on uninitialised value(s) ==31523== at 0x80585DC: FindColor (colormap.c:1226) ==31523== by 0x8058CDD: FakeAllocColor (colormap.c:1017) ==31523== by 0x80D1EFA: miSpriteFindColors (misprite.c:548) ==31523== by 0x80D226F: miSpriteSetCursor (misprite.c:661) ==31523== by 0x80CA99A: miPointerUpdateSprite (mipointer.c:343) ==31523== by 0x80CAAF4: miPointerDisplayCursor (mipointer.c:188) ==31523== by 0x80E038D: CursorDisplayCursor (cursor.c:136) ==31523== by 0x811EDC4: AnimCurDisplayCursor (animcur.c:234) ==31523== by 0x806F18A: DefineInitialRootWindow (events.c:2118) ==31523== by 0x8078C3C: main (main.c:451) ==31523== FindColor() uses the initial pixel value as a guide in its search, so ensure it is set before calling FindColor(). --- dix/colormap.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dix/colormap.c b/dix/colormap.c index 73b6669..8836737 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -1013,6 +1013,7 @@ FakeAllocColor (ColormapPtr pmap, xColorItem *item) switch (class) { case GrayScale: case PseudoColor: + temp = 0; item->pixel = 0; if (FindColor(pmap, pmap->red, entries, &rgb, &temp, PSEUDOMAP, -1, AllComp) == Success) { -- 1.4.4.2