From ffdfd34e6b500e780e90f2a41da368e0d6107c86 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 30 Jan 2018 14:27:30 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5838 --- MagickCore/geometry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MagickCore/geometry.c b/MagickCore/geometry.c index 138fe702c..7cfc8cd02 100644 --- a/MagickCore/geometry.c +++ b/MagickCore/geometry.c @@ -1494,8 +1494,8 @@ MagickExport MagickStatusType ParseMetaGeometry(const char *geometry,ssize_t *x, (void) ParseGeometry(geometry,&geometry_info); area=geometry_info.rho+sqrt(MagickEpsilon); distance=sqrt((double) former_width*former_height); - scale.x=(double) former_width/(distance/sqrt(area)); - scale.y=(double) former_height/(distance/sqrt(area)); + scale.x=(double) former_width*PerceptibleReciprocal(distance/sqrt(area)); + scale.y=(double) former_height*PerceptibleReciprocal(distance/sqrt(area)); if ((scale.x < (double) *width) || (scale.y < (double) *height)) { *width=(unsigned long) (former_width/(distance/sqrt(area))); -- 2.40.0