Bug 10464 - FakeAllocColor(): Conditional jump or move depends on uninitialised value(s)
Summary: FakeAllocColor(): Conditional jump or move depends on uninitialised value(s)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: * Other (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: xorg-7.4
  Show dependency treegraph
 
Reported: 2007-03-29 13:30 UTC by Chris Wilson
Modified: 2008-02-29 13:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Set the pixel value to zero before commencing FindColor (1.49 KB, patch)
2007-03-29 13:52 UTC, Chris Wilson
no flags Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Wilson 2007-03-29 13:30:22 UTC
==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)

Trivial fix:
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) {
Comment 1 Chris Wilson 2007-03-29 13:52:49 UTC
Created attachment 9363 [details] [review]
Set the pixel value to zero before commencing FindColor
Comment 2 Adam Jackson 2008-02-29 13:42:34 UTC
Fixed in git, thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.