File ImageMagick-CVE-2017-11170.patch of Package ImageMagick.8212

Index: ImageMagick-6.8.8-1/coders/tga.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/tga.c	2018-02-13 16:21:46.166336227 +0100
+++ ImageMagick-6.8.8-1/coders/tga.c	2018-02-13 16:22:02.154599570 +0100
@@ -262,6 +262,8 @@ static Image *ReadTGAImage(const ImageIn
 
           one=1;
           image->colors=one << tga_info.bits_per_pixel;
+          if (image->colors > ((~0UL)/sizeof(*image->colormap)))
+            ThrowReaderException(CorruptImageError,"ImproperImageHeader");
           if (AcquireImageColormap(image,image->colors) == MagickFalse)
             ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         }