The attached tiff-bug-mac.tiff image corrupts the memory heap, when loaded in MSVC compiled Windows executable, with the 3.19.0-2021 and 3.18 versions of FreeImage.
The same image, when saved from Photoshop in "IBM PC" byte order (also attached: tiff-no-bug-pc.tif) doesn't corrupt memory.
The error is triggered inside:
tiff_read_exif_profile >
TIFFReadEXIFDirectory >
TIFFReadCustomDirectory >
TIFFFreeDirectory
You could try https://sourceforge.net/p/freeimage/patches/152/
I confirm this patch fixed the problem with these TIFF files - the previously reported bug #346.
Thank you so much @toxie!
Last edit: Jorge Diogo 2022-10-11