From 22043bcfdedacd27879490d0c0da92c236b1d476 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 17 Mar 2018 08:00:11 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6981 --- coders/wpg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.40.0