From: Dirk Lemstra Date: Sat, 28 Apr 2018 13:44:28 +0000 (+0200) Subject: Call SetImageBackgroundColor before we call MergeImageLayers (https://oss-fuzz.com... X-Git-Tag: 7.0.7-29~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb4a80e7ef2bbfddcb88a4ef0ec80fda90f54950;p=imagemagick Call SetImageBackgroundColor before we call MergeImageLayers (https://oss-fuzz.com/v2/testcase-detail/5123755102699520) --- diff --git a/coders/psd.c b/coders/psd.c index 1dcac026d..c587f47ce 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -2362,9 +2362,9 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) profile=DestroyStringInfo(profile); ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); } - SetImageAlphaChannel(image,TransparentAlphaChannel,exception); image->background_color.alpha=TransparentAlpha; image->background_color.alpha_trait=BlendPixelTrait; + (void) SetImageBackgroundColor(image,exception); merged=MergeImageLayers(image,FlattenLayer,exception); ReplaceImageInList(&image,merged); }