From 8aec657c0e0977b00ace2ad11c642f9a780fa6c5 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 2 Mar 2018 19:53:45 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6677 --- coders/mpc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coders/mpc.c b/coders/mpc.c index f497af9e9..ee95e6f84 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -781,8 +781,11 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) */ if ((LocaleCompare(id,"MagickCache") != 0) || (image->storage_class == UndefinedClass) || - (image->compression == UndefinedCompression) || (image->columns == 0) || - (image->rows == 0)) + (image->compression == UndefinedCompression) || + (image->columns == 0) || (image->rows == 0) || + (image->number_channels > MaxPixelChannels) || + (image->number_meta_channels > MaxPixelChannels) || + ((image->number_channels+image->number_meta_channels) >= MaxPixelChannels)) { if (profiles != (LinkedListInfo *) NULL) profiles=DestroyLinkedList(profiles,RelinquishMagickMemory); -- 2.40.0