ImageMagick/ImageMagick6

Resizing TIFF, realloc(): invalid next size

jarilehtinen opened this issue · 3 comments

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

Read the input first

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

image

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 

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