From: Cristy Date: Sat, 17 Mar 2018 12:15:16 +0000 (-0400) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6983 X-Git-Tag: 7.0.7-27~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73358ebfef494fed27d5351fef328dbe36583ef3;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6983 --- diff --git a/coders/wpg.c b/coders/wpg.c index 9ea2b1780..2b16c7e12 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -589,8 +589,9 @@ static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception) } break; case 0x7E: - (void) FormatLocaleFile(stderr, - "\nUnsupported WPG token XOR, please report!"); + if (y == 0) + (void) FormatLocaleFile(stderr, + "\nUnsupported WPG token XOR, please report!"); XorMe=!XorMe; break; case 0x7F: @@ -1434,8 +1435,9 @@ static Image *ReadWPGImage(const ImageInfo *image_info, } case 1: /*RLE for WPG2 */ { - if( UnpackWPG2Raster(image,bpp,exception) < 0) - goto DecompressionFailed; + if (!image->ping) + if( UnpackWPG2Raster(image,bpp,exception) < 0) + goto DecompressionFailed; break; } }