]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6847
authorCristy <urban-warrior@imagemagick.org>
Tue, 13 Mar 2018 00:47:25 +0000 (20:47 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 13 Mar 2018 00:47:43 +0000 (20:47 -0400)
MagickCore/draw.c

index 3ce289e8bd252e34cdc2455fc77aa2236e57c925..7417ab85876ac9ac5490b47c9d5d78e90f20cf7f 100644 (file)
@@ -4968,12 +4968,13 @@ static MagickBooleanType DrawStrokePolygon(Image *image,
     if (stroke_polygon == (PrimitiveInfo *) NULL)
       {
         status=0;
+        stroke_polygon=(PrimitiveInfo *) RelinquishMagickMemory(stroke_polygon);
         break;
       }
     status&=DrawPolygonPrimitive(image,clone_info,stroke_polygon,exception);
+    stroke_polygon=(PrimitiveInfo *) RelinquishMagickMemory(stroke_polygon);
     if (status == 0)
       break;
-    stroke_polygon=(PrimitiveInfo *) RelinquishMagickMemory(stroke_polygon);
     q=p+p->coordinates-1;
     closed_path=(fabs(q->point.x-p->point.x) < DrawEpsilon) &&
       (fabs(q->point.y-p->point.y) < DrawEpsilon) ? MagickTrue : MagickFalse;