From: Cristy Date: Fri, 4 Aug 2017 11:28:44 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/645 X-Git-Tag: 7.0.6-6~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5e05878caac35b0c8e852791ccfcc77a1390958;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/645 --- diff --git a/coders/psd.c b/coders/psd.c index e7c4406af..de5578bac 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -1741,6 +1741,12 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image, unsigned char *info; + if (length > GetBlobSize(image)) + { + layer_info=DestroyLayerInfo(layer_info,number_layers); + ThrowBinaryException(CorruptImageError, + "InsufficientImageDataInFile",image->filename); + } layer_info[i].info=AcquireStringInfo((const size_t) length); info=GetStringInfoDatum(layer_info[i].info); (void) ReadBlob(image,(const size_t) length,info);