From: Cristy Date: Sun, 4 Feb 2018 21:18:57 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5680 X-Git-Tag: 7.0.7-23~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=197b6bfef9650f87a50f740762118e00e069d906;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5680 --- diff --git a/coders/wpg.c b/coders/wpg.c index 1c2788382..5d634decc 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -1169,6 +1169,9 @@ static Image *ReadWPGImage(const ImageInfo *image_info, if ((image->storage_class != PseudoClass) && (bpp < 24)) { image->colors=one << bpp; + if (image->colors > GetBlobSize(image)) + ThrowReaderException(CorruptImageError, + "InsufficientImageDataInFile"); if (!AcquireImageColormap(image,image->colors,exception)) { NoMemory: