]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6549
authorCristy <urban-warrior@imagemagick.org>
Sun, 25 Feb 2018 02:29:23 +0000 (21:29 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 25 Feb 2018 02:29:23 +0000 (21:29 -0500)
coders/psd.c

index 2f5f60db495ea257e0fa11ee8a499875ddcdab07..b4e801de988698f2f5a8885c08d0cd9e14aa38b1 100644 (file)
@@ -2326,13 +2326,23 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
         *merged;
 
       if (GetImageListLength(image) == 1)
-        ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+        {
+          if (profile != (StringInfo *) NULL)
+            profile=DestroyStringInfo(profile);
+          ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+        }
       SetImageAlphaChannel(image,TransparentAlphaChannel,exception);
       image->background_color.alpha=TransparentAlpha;
       image->background_color.alpha_trait=BlendPixelTrait;
       merged=MergeImageLayers(image,FlattenLayer,exception);
       ReplaceImageInList(&image,merged);
     }
+  if (profile != (StringInfo *) NULL)
+    {
+      (void) SetImageProfile(image,GetStringInfoName(profile),profile,
+        exception);
+      profile=DestroyStringInfo(profile);
+    }
   (void) CloseBlob(image);
   return(GetFirstImageInList(image));
 }