]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6677
authorCristy <urban-warrior@imagemagick.org>
Sat, 3 Mar 2018 00:53:45 +0000 (19:53 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sat, 3 Mar 2018 00:53:45 +0000 (19:53 -0500)
coders/mpc.c

index f497af9e9ba141d43fc7dd6390b698f2fac243d9..ee95e6f84c30eab147729b840827410aed9f1ca4 100644 (file)
@@ -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);