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

From c52b177e0cb11c896b8cc9525a3184c5c0f322c3 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Wed, 26 Apr 2017 16:21:23 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/444

---
 coders/aai.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/coders/aai.c b/coders/aai.c
index 5384064..d3e5b69 100644
--- a/coders/aai.c
+++ b/coders/aai.c
@@ -173,7 +173,10 @@ static Image *ReadAAIImage(const ImageInfo *image_info,ExceptionInfo *exception)
     {
       count=ReadBlob(image,length,pixels);
       if ((size_t) count != length)
-        ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+        {
+          pixels=(unsigned char *) RelinquishMagickMemory(pixels);
+          ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+        }
       p=pixels;
       q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
       if (q == (PixelPacket *) NULL)