ImageMagick / ImageMagick6

🧙‍♂️ ImageMagick 6
https://legacy.imagemagick.org
Other
198 stars 82 forks source link

Resizing TIFF, realloc(): invalid next size #290

Closed jarilehtinen closed 8 months ago

jarilehtinen commented 10 months ago

ImageMagick version

6.9.12-93

Operating system

Linux

Operating system, version and so on

Rocky Linux 9.3

Description

Trying to convert and resize a TIFF image but getting error:

realloc(): invalid next size
[1]    2491270 IOT instruction (core dumped)  convert -resize x1000 -quality 80 -colorspace sRGB -flatten

Works fine in 6.9.12-86

Steps to Reproduce

convert -resize x1000 -quality 80 -colorspace sRGB -flatten image.tif image.png

Images

image.tif.zip

fmw42 commented 10 months ago

Read the input first

convert image.tif -resize x1000 -colorspace sRGB -flatten -quality 80 image.png

image

jarilehtinen commented 10 months ago

Read the input first

convert image.tif -resize x1000 -colorspace sRGB -flatten -quality 80 image.png

Thanks for the suggestion. First I reported that this fixed it, but it didn't, tested with the wrong version (deleted that comment).

So some TIFFs work, some don't, including the attached one. Issue persists.

$ convert image.tif -resize x1000 -colorspace sRGB -flatten -quality 80 image.png
realloc(): invalid next size
[1]    2557812 IOT instruction (core dumped)  convert image.tif -resize x1000 -colorspace sRGB -flatten -quality 80 
dlemstra commented 10 months ago

I just pushed a patch that should resolve the realloc issue. This will become available in the next release.