From 7d537cdb2839b1b1bff2f9c769d7f39496ff210f Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 15 Sep 2019 10:51:20 -0400 Subject: [PATCH] ... --- MagickCore/draw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 3bea06dfb..db211a939 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -6014,7 +6014,7 @@ static MagickBooleanType TraceArcPath(MVGInfo *mvg_info,const PointInfo start, return(TracePoint(primitive_info,end)); radii.x=fabs(arc.x); radii.y=fabs(arc.y); - if ((fabs(radii.x) < MagickEpsilon) || (fabs(radii.y) < MagickEpsilon)) + if ((radii.x < MagickEpsilon) || (radii.y < MagickEpsilon)) return(TraceLine(primitive_info,start,end)); cosine=cos(DegreesToRadians(fmod((double) angle,360.0))); sine=sin(DegreesToRadians(fmod((double) angle,360.0))); @@ -6023,7 +6023,7 @@ static MagickBooleanType TraceArcPath(MVGInfo *mvg_info,const PointInfo start, delta=(center.x*center.x)/(radii.x*radii.x)+(center.y*center.y)/ (radii.y*radii.y); if (delta < MagickEpsilon) - return(TraceLine(primitive_info,start,end)); + return(TraceLine(primitive_info,start,end)); if (delta > 1.0) { radii.x*=sqrt((double) delta); @@ -6035,6 +6035,8 @@ static MagickBooleanType TraceArcPath(MVGInfo *mvg_info,const PointInfo start, points[1].y=(double) (cosine*end.y/radii.y-sine*end.x/radii.y); alpha=points[1].x-points[0].x; beta=points[1].y-points[0].y; + if (fabs(alpha*alpha+beta*beta) < MagickEpsilon) + return(TraceLine(primitive_info,start,end)); factor=PerceptibleReciprocal(alpha*alpha+beta*beta)-0.25; if (factor <= 0.0) factor=0.0; -- 2.40.0