From: Cristy Date: Fri, 2 Mar 2018 01:26:15 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6641 X-Git-Tag: 7.0.7-25~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8b36ec5b658fdf50bd3b833fa94b21f22975dad;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6641 --- diff --git a/coders/rle.c b/coders/rle.c index 1a2e02a63..866d315ce 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -243,6 +243,8 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((number_planes == 0) || (number_planes == 2) || ((flags & 0x04) && ((number_planes <= 2) || number_planes > 254)) || (bits_per_pixel != 8)) ThrowRLEException(CorruptImageError,"ImproperImageHeader"); + if (number_planes > 4) + ThrowRLEException(CorruptImageError,"ImproperImageHeader"); if ((image->columns == 0) || (image->columns >= 32768) || (image->rows == 0) || (image->rows >= 32768)) ThrowRLEException(CorruptImageError,"ImproperImageHeader");