I was using an old version version of libpng and zlib in that case (because I used what was provided by the Ubuntu distribution managers). Sorry for the lack of details, but I didn't expect this to be hard for others to reproduce.
I've had a chance to try it with the latest libpng, and it didn't help.
Code: Select all
PNG* rw- Portable Network Graphics (libpng 1.5.10)
"valgrind --track-origins=yes" gives more details, such as
Code: Select all
Conditional jump or move depends on uninitialised value(s)
at 0x6A3CCE: png_write_find_filter (pngwutil.c:2620)
by 0x6A0D13: png_write_row (pngwrite.c:814)
by 0x533118: WriteOnePNGImage (png.c:10487)
by 0x536ADF: WritePNGImage (png.c:11576)
by 0x576FD2: WriteImage (constitute.c:1228)
by 0x5793D0: WriteImages (constitute.c:1377)
by 0x63C838: ConvertImageCommand (convert.c:3026)
by 0x657AA5: MagickCommandGenesis (mogrify.c:159)
by 0x40AC24: main (convert.c:81)
Uninitialised value was created by a heap allocation
at 0x4C2415D: malloc (vg_replace_malloc.c:195)
by 0x555B2E: OpenPixelCache (cache.c:3913)
by 0x55876A: GetImagePixelCache (cache.c:2092)
by 0x5589B1: QueueAuthenticPixelCacheNexus (cache.c:4367)
by 0x5568B0: QueueAuthenticPixels (cache.c:4530)
by 0x528819: ReadOnePNGImage (png.c:2888)
by 0x529140: ReadPNGImage (png.c:3670)
by 0x577967: ReadImage (constitute.c:590)
by 0x578B4A: ReadImages (constitute.c:903)
by 0x63A725: ConvertImageCommand (convert.c:598)
by 0x657AA5: MagickCommandGenesis (mogrify.c:159)
by 0x40AC24: main (convert.c:81)
which suggests a patch that is probably overkill, but does seem to work.
Code: Select all
--- magick/cache.c.orig 2012-05-06 14:59:24.000000000 -0400
+++ magick/cache.c 2012-05-17 15:26:03.143246372 -0400
@@ -3912,6 +3912,7 @@
cache_info->mapped=MagickFalse;
cache_info->pixels=(PixelPacket *) AcquireMagickMemory((size_t)
cache_info->length);
+ if (cache_info->pixels) ResetMagickMemory(cache_info->pixels,0,cache_info->length);
if (cache_info->pixels == (PixelPacket *) NULL)
{
cache_info->mapped=MagickTrue;