Page 1 of 1

ImageMagick crashes on imperfect TIFF files

Posted: 2008-12-09T09:32:55-07:00
by dirving
It seems that ImageMagick 6.4.7 crashes when it encounters problems in a TIFF file where it would previously just warn. An example file is:

http://wbd.wbdhost.com/vn-0ixzcem.tif

If I run 'identify -verbose vn-0ixzcern.tif' using ImageMagick 6.4.7-4 I get a segmentation fault while if I run it using ImageMagick 6.3.8 I get:

[normal image information]
...
Properties:
Signature: b69cd3e762ba7bac64dc88e438ce40d36b516cac6cbcdd2172242a086dfb6342
Tiff:rows-per-strip: 2
Tiff:software: Adobe Photoshop CS3 Macintosh
Tiff:timestamp: 2008:11:04 08:48:30
Profiles:
Profile-icc: 557168 bytes
U.S. Web Coated (SWOP) v2
Profile-tiff:37724: 564464 bytes
Artifacts:
Verbose: true
Tainted: False
Version: ImageMagick 6.3.8 04/23/08 Q16 http://www.imagemagick.org
identify: ./vn-0ixzcem.tif: wrong data type 7 for "XMLPacket"; tag ignored. `TIFFReadDirectory'.
identify: ./vn-0ixzcem.tif: wrong data type 7 for "RichTIFFIPTC"; tag ignored. `TIFFReadDirectory'.
identify: ./vn-0ixzcem.tif: wrong data type 7 for "Photoshop"; tag ignored. `TIFFReadDirectory'.
identify: ./vn-0ixzcem.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory'.

Valgrind states the following:

==4361== Invalid read of size 1
==4361== at 0x4007707: memcpy (mc_replace_strmem.c:402)
==4361== by 0x4210DA9: CopyMagickMemory (memory.c:459)
==4361== by 0x426B401: SetStringInfoDatum (string.c:1652)
==4361== by 0x4010483: ReadProfile (tiff.c:294)
==4361== by 0x4011C46: ReadTIFFImage (tiff.c:358)
==4361== by 0x417EF77: ReadImage (constitute.c:572)
==4361== by 0x40BECCB: MagickReadImage (magick-image.c:7613)

Re: ImageMagick crashes on imperfect TIFF files

Posted: 2008-12-09T09:41:10-07:00
by magick
We can reproduce the problem you reported and will have a patch for ImageMagick 6.4.7-5 available sometime tomorrow. Thanks.