From: Cristy Date: Thu, 23 Nov 2017 14:05:46 +0000 (-0500) Subject: ... X-Git-Tag: 7.0.7-12~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb554d124be4c0b440d253bddb06e86665a7c61c;p=imagemagick ... --- diff --git a/coders/wpg.c b/coders/wpg.c index 3680282a7..e288e2617 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -1096,8 +1096,6 @@ static Image *ReadWPGImage(const ImageInfo *image_info, if ((BitmapHeader2.Width == 0) || (BitmapHeader2.Height == 0)) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); BitmapHeader2.Depth=ReadBlobLSBShort(image); - if (BitmapHeader2.Depth > 32) - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); BitmapHeader2.HorzRes=ReadBlobLSBShort(image); BitmapHeader2.VertRes=ReadBlobLSBShort(image); @@ -1118,6 +1116,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info, bpp=BitmapHeader2.Depth; UnpackRaster: + if (bpp > 32) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) break;