summaryrefslogtreecommitdiff
path: root/render/miindex.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-02-29 16:39:29 -0500
committerAdam Jackson <ajax@redhat.com>2008-02-29 16:39:29 -0500
commit8f0a4282f0ac33625eda9466e3db0bcef64e403a (patch)
tree283c0300499e0265991b3dd81d74523c4e7e2d82 /render/miindex.c
parentb7eb92774a58639aff3f26bb28a3dcff910c3fb6 (diff)
Bug #10463: Always initialize reference pixel before AllocColor()
Diffstat (limited to 'render/miindex.c')
-rw-r--r--render/miindex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/render/miindex.c b/render/miindex.c
index 0e12dca4a..4e0cf0084 100644
--- a/render/miindex.c
+++ b/render/miindex.c
@@ -147,6 +147,7 @@ miBuildRenderColormap (ColormapPtr pColormap, Pixel *pixels, int *nump)
for (g = 0; g < cube; g++)
for (b = 0; b < cube; b++)
{
+ pixel = 0;
red = (r * 65535 + (cube-1)/2) / (cube - 1);
green = (g * 65535 + (cube-1)/2) / (cube - 1);
blue = (b * 65535 + (cube-1)/2) / (cube - 1);
@@ -157,6 +158,7 @@ miBuildRenderColormap (ColormapPtr pColormap, Pixel *pixels, int *nump)
}
for (g = 0; g < gray; g++)
{
+ pixel = 0;
red = green = blue = (g * 65535 + (gray-1)/2) / (gray - 1);
if (AllocColor (pColormap, &red, &green, &blue, &pixel, 0) != Success)
return FALSE;