From: Dirk Lemstra Date: Sun, 1 Apr 2018 16:02:54 +0000 (+0200) Subject: Added extra check (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7266) X-Git-Tag: 7.0.7-29~221 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8ffd7100cc96db5b1324297f078b3e6b12f28eb;p=imagemagick Added extra check (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7266) --- diff --git a/coders/psd.c b/coders/psd.c index ce5c90859..f0c39d80b 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -1235,6 +1235,9 @@ static MagickBooleanType ReadPSDChannelZip(Image *image,const size_t channels, (void) LogMagickEvent(CoderEvent,GetMagickModule(), " layer data is ZIP compressed"); + if ((MagickSizeType) compact_size > GetBlobSize(image)) + ThrowBinaryException(CorruptImageError,"UnexpectedEndOfFile", + image->filename); compact_pixels=(unsigned char *) AcquireQuantumMemory(compact_size, sizeof(*compact_pixels)); if (compact_pixels == (unsigned char *) NULL)