From fc742abb288c2347300f823ad51f97ed941d9b80 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 19 Mar 2018 19:41:58 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7022 --- MagickCore/draw.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 608aebb88..0c78a06fc 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -91,6 +91,7 @@ */ #define BezierQuantum 200 #define DrawEpsilon (1.0e-10) +#define EllipseEpsilon (0.0001) #define ThrowPointExpectedException(token,exception) \ { \ (void) ThrowMagickException(exception,GetMagickModule(),DrawError, \ @@ -1682,8 +1683,8 @@ static size_t EllipsePoints(const PrimitiveInfo *primitive_info, step=MagickPI/8.0; if ((delta >= 0.0) && (delta < (MagickPI/8.0))) step=MagickPI/(4.0*(MagickPI*PerceptibleReciprocal(delta)/2.0)); - if (step < 0.00001) - step=0.00001; + if (step < EllipseEpsilon) + step=EllipseEpsilon; angle.x=DegreesToRadians(degrees.x); y=degrees.y; while (y < degrees.x) @@ -5509,8 +5510,8 @@ static void TraceEllipse(PrimitiveInfo *primitive_info,const PointInfo start, step=MagickPI/8.0; if ((delta >= 0.0) && (delta < (MagickPI/8.0))) step=MagickPI/(4.0*(MagickPI*PerceptibleReciprocal(delta)/2.0)); - if (step < 0.00001) - step=0.00001; + if (step < EllipseEpsilon) + step=EllipseEpsilon; angle.x=DegreesToRadians(degrees.x); y=degrees.y; while (y < degrees.x) -- 2.40.0