From: Cristy Date: Sat, 17 Mar 2018 12:00:11 +0000 (-0400) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6981 X-Git-Tag: 7.0.7-27~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22043bcfdedacd27879490d0c0da92c236b1d476;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6981 --- diff --git a/coders/wpg.c b/coders/wpg.c index 749eee924..9ea2b1780 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -1062,6 +1062,7 @@ static Image *ReadWPGImage(const ImageInfo *image_info, image->columns = 1; image->rows = 1; image->colors = 0; + (void) ResetImagePixels(image,exception); bpp=0; BitmapHeader2.RotAngle=0; Rec2.RecordLength=0; @@ -1178,7 +1179,7 @@ static Image *ReadWPGImage(const ImageInfo *image_info, status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) break; - (void) SetImageBackgroundColor(image,exception); + (void) ResetImagePixels(image,exception); if ((image->storage_class != PseudoClass) && (bpp < 24)) { image->colors=one << bpp; @@ -1384,7 +1385,7 @@ static Image *ReadWPGImage(const ImageInfo *image_info, status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) break; - (void) SetImageBackgroundColor(image,exception); + (void) ResetImagePixels(image,exception); if ((image->colors == 0) && (bpp != 24)) { image->colors=one << bpp;