]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7258
authorCristy <urban-warrior@imagemagick.org>
Sun, 1 Apr 2018 12:08:30 +0000 (08:08 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 1 Apr 2018 12:08:30 +0000 (08:08 -0400)
MagickCore/draw.c

index 3caca1e5663068ce4c1979e9f986fb0eb94c6552..26dd1d9cee4eb5ef45c2fc3472f1233aaf5d9ef3 100644 (file)
@@ -1681,9 +1681,7 @@ static size_t GetEllipseCoordinates(const PointInfo start,const PointInfo stop,
   /*
     Ellipses are just short segmented polys.
   */
-  if ((fabs(stop.x) < DrawEpsilon) && (fabs(stop.y) < DrawEpsilon))
-    return(1);
-  delta=2.0/MagickMax(stop.x,stop.y);
+  delta=2.0*PerceptibleReciprocal(MagickMax(stop.x,stop.y));
   step=MagickPI/8.0;
   if ((delta >= 0.0) && (delta < (MagickPI/8.0)))
     step=MagickPI/(4.0*(MagickPI*PerceptibleReciprocal(delta)/2.0));
@@ -5526,12 +5524,7 @@ static void TraceEllipse(PrimitiveInfo *primitive_info,const PointInfo start,
   /*
     Ellipses are just short segmented polys.
   */
-  if ((fabs(stop.x) < DrawEpsilon) && (fabs(stop.y) < DrawEpsilon))
-    {
-      TracePoint(primitive_info,start);
-      return;
-    }
-  delta=2.0/MagickMax(stop.x,stop.y);
+  delta=2.0*PerceptibleReciprocal(MagickMax(stop.x,stop.y));
   step=MagickPI/8.0;
   if ((delta >= 0.0) && (delta < (MagickPI/8.0)))
     step=MagickPI/(4.0*(MagickPI*PerceptibleReciprocal(delta)/2.0));