From 73358ebfef494fed27d5351fef328dbe36583ef3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 17 Mar 2018 08:15:16 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6983 --- coders/wpg.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; } } -- 2.40.0