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

Index: ImageMagick-6.8.8-1/coders/avs.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/avs.c	2013-12-01 15:47:50.000000000 +0100
+++ ImageMagick-6.8.8-1/coders/avs.c	2017-04-25 10:01:28.215052947 +0200
@@ -167,7 +167,10 @@ static Image *ReadAVSImage(const ImageIn
     {
       count=ReadBlob(image,length,pixels);
       if ((size_t) count != length)
+      {
+        pixels=(unsigned char *) RelinquishMagickMemory(pixels);
         ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+      }
       p=pixels;
       q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
       if (q == (PixelPacket *) NULL)