]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/599
authorCristy <urban-warrior@imagemagick.org>
Sun, 23 Jul 2017 14:43:59 +0000 (10:43 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 23 Jul 2017 14:43:59 +0000 (10:43 -0400)
coders/psd.c

index 46e7fe24ec7cdaa12e9f9d2a232b0c62778309ac..e7c4406af1bc074d1783c61fcb6de31abe7b8eb7 100644 (file)
@@ -2110,6 +2110,8 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "  reading image resource blocks - %.20g bytes",(double)
           ((MagickOffsetType) length));
+      if (length > GetBlobSize(image))
+        ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
       blocks=(unsigned char *) AcquireQuantumMemory((size_t) length,
         sizeof(*blocks));
       if (blocks == (unsigned char *) NULL)