File ImageMagick-CVE-2018-9018.patch of Package ImageMagick.8212

Index: ImageMagick-6.8.8-1/coders/png.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/png.c	2018-04-13 19:30:26.690187790 +0200
+++ ImageMagick-6.8.8-1/coders/png.c	2018-04-13 19:30:26.894191339 +0200
@@ -5721,9 +5721,11 @@ static Image *ReadOneMNGImage(MngInfo* m
 
                     if (change_delay && (p-chunk) < (ssize_t) (length-4))
                       {
-                          frame_delay=1UL*image->ticks_per_second*
-                            mng_get_long(p);
-
+                        if (mng_info->ticks_per_second == 0)
+                          frame_delay=0;
+                        else
+                          frame_delay=(100*(mng_get_long(p))/
+                                       mng_info->ticks_per_second);
                         if (mng_info->ticks_per_second != 0)
                           frame_delay/=mng_info->ticks_per_second;
 
@@ -5742,9 +5744,11 @@ static Image *ReadOneMNGImage(MngInfo* m
 
                     if (change_timeout && (p-chunk) < (ssize_t) (length-4))
                       {
-                        frame_timeout=1UL*image->ticks_per_second*
-                          mng_get_long(p);
-
+                        if (mng_info->ticks_per_second == 0)
+                          frame_timeout=0;
+                        else
+                          frame_timeout=
+                            (100*(mng_get_long(p))/mng_info->ticks_per_second);
                         if (mng_info->ticks_per_second != 0)
                           frame_timeout/=mng_info->ticks_per_second;