From ba97c537f9643921dc5ebbcd81ab37ad1eca395b Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 7 Feb 2018 17:53:37 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6077 --- coders/viff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coders/viff.c b/coders/viff.c index 34d7d2b74..4cbf264c8 100644 --- a/coders/viff.c +++ b/coders/viff.c @@ -418,6 +418,8 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + if ((MagickSizeType) viff_info.map_rows > GetBlobSize(image)) + ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); if ((MagickSizeType) viff_info.map_rows > (viff_info.map_rows*bytes_per_pixel*sizeof(*viff_colormap))) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); -- 2.40.0