File ImageMagick-CVE-2020-27756.patch of Package ImageMagick.19146

Index: ImageMagick-7.0.7-34/MagickCore/geometry.c
===================================================================
--- ImageMagick-7.0.7-34.orig/MagickCore/geometry.c	2018-05-20 17:55:43.000000000 +0200
+++ ImageMagick-7.0.7-34/MagickCore/geometry.c	2020-12-09 16:17:47.833895846 +0100
@@ -1409,13 +1409,13 @@ MagickExport MagickStatusType ParseMetaG
       if (geometry_ratio >= image_ratio)
         {
           *width=former_width;
-          *height=(size_t) floor((double) (former_height*image_ratio/
-            geometry_ratio)+0.5);
+          *height=(size_t) floor((double) (PerceptibleReciprocal(
+            geometry_ratio)*former_height*image_ratio)+0.5);
         }
       else
         {
-          *width=(size_t) floor((double) (former_width*geometry_ratio/
-            image_ratio)+0.5);
+          *width=(size_t) floor((double) (PerceptibleReciprocal(
+            image_ratio)*former_width*geometry_ratio)+0.5);
           *height=former_height;
         }
       former_width=(*width);
openSUSE Build Service is sponsored by