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

Index: ImageMagick-6.8.8-1/coders/png.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/png.c	2018-01-12 11:03:23.475294270 +0100
+++ ImageMagick-6.8.8-1/coders/png.c	2018-01-12 11:08:25.056311657 +0100
@@ -2106,6 +2106,9 @@ static Image *ReadOnePNGImage(MngInfo *m
     x_resolution,
     y_resolution;
 
+  QuantumInfo
+    *volatile quantum_info;
+
   ssize_t
     ping_rowbytes,
     y;
@@ -2297,6 +2300,7 @@ static Image *ReadOnePNGImage(MngInfo *m
     }
 
   pixel_info=(MemoryInfo *) NULL;
+  quantum_info = (QuantumInfo *) NULL;
 
   if (setjmp(png_jmpbuf(ping)))
     {
@@ -2312,6 +2316,9 @@ static Image *ReadOnePNGImage(MngInfo *m
       if (pixel_info != (MemoryInfo *) NULL)
         pixel_info=RelinquishVirtualMemory(pixel_info);
 
+      if (quantum_info != (QuantumInfo *) NULL)
+        quantum_info=DestroyQuantumInfo(quantum_info);
+
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "  exit ReadOnePNGImage() with error.");
@@ -3213,9 +3220,6 @@ static Image *ReadOnePNGImage(MngInfo *m
 
   if (image->storage_class == DirectClass)
     {
-      QuantumInfo
-        *quantum_info;
-
       quantum_info=AcquireQuantumInfo(image_info,image);
 
       if (quantum_info == (QuantumInfo *) NULL)