File ImageMagick-CVE-2015-8894.patch of Package ImageMagick.8212

From 4f68e9661518463fca523c9726bb5d940a2aa6d8 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Mon, 31 Aug 2015 16:19:40 -0400
Subject: [PATCH] 
 https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1490362

---
 coders/tga.c | 2 ++
 1 file changed, 2 insertions(+)

Index: ImageMagick-6.8.9-8/coders/tga.c
===================================================================
--- ImageMagick-6.8.9-8.orig/coders/tga.c	2016-06-09 09:04:06.788342368 +0200
+++ ImageMagick-6.8.9-8/coders/tga.c	2016-06-09 09:07:10.551457093 +0200
@@ -314,6 +314,8 @@ static Image *ReadTGAImage(const ImageIn
       /*
         Read TGA raster colormap.
       */
+      if (image->colors < tga_info.colormap_index)
+        image->colors=tga_info.colormap_index;
       if (AcquireImageColormap(image,image->colors) == MagickFalse)
         ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
       for (i=0; i < (ssize_t) image->colors; i++)