Imagemagick: Error (segfault/width or height exceeds limit) when resizing PSD image from version >= 6.9.x

Created on 22 Aug 2017  路  3Comments  路  Source: ImageMagick/ImageMagick

We encountered a problem while using ImageMagick to resize a PSD file created with _Adobe Photoshop CC 2015.5 (Windows)_ in version:

Version: ImageMagick 6.9.6-6 Q16 x86_64 20161125 http://www.imagemagick.org

The following command, with the image attached, gets a segmentation fault:

$ convert 400x200.psd -resize 1368x1200 1368x1200.psd
Aborted (core dumped)

This doesn't happen in some earlier versions we tested, a correctly resized file is produced. In newer versions, however, the error we get is different. For example:

$ convert -version
Version: ImageMagick 7.0.6-9 Q16 x86_64 2017-08-21 http://www.imagemagick.org

$ convert 400x200.psd -resize 1368x1200 1368x1200.psd
convert: width or height exceeds limit `/tmp/400x200.psd' @ error/cache.c/OpenPixelCache/3510.

We tried bumping the limits in policy.xml but nothing made a difference.

This is a summary of all the versions we tested and the result:

ubuntu 6.6.9-7: ok, 15MB result
osx 6.7.7-10: ok, 15MB result
osx 6.8.7-0: ok, 15MB result
ubuntu: 6.9.6-6: segmentaion fault
osx 6.9.9-9: convert: width or height exceeds limit `400x200.psd' @ error/cache.c/OpenPixelCache/3900.
osx, ubuntu 7.0.6-9: convert: width or height exceeds limit `400x200.psd' @ error/cache.c/OpenPixelCache/3510.

Let me know if you need any more details 馃槂

400x200.psd.zip

All 3 comments

One of the layers is setting the image dimensions to 4294967296 which is likely a negative value assigned to an size_t. One of the developers will investigate and report back here in a day or two.

Thanks for reporting this. I just pushed some patches to fix this to our git repository. This will be resolved in the next version of ImageMagick.

Thanks for the quick response @mikayla-grace and @dlemstra! 馃檶

Was this page helpful?
0 / 5 - 0 ratings