]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <mikayla-grace@urban-warrior.org>
Sun, 17 Feb 2019 18:12:54 +0000 (13:12 -0500)
committerCristy <mikayla-grace@urban-warrior.org>
Sun, 17 Feb 2019 18:12:54 +0000 (13:12 -0500)
MagickCore/annotate.c
MagickCore/draw.c

index ee980d87428040e6fea87cc07626d236e5cfe405..6106246b96ab805eb483cfe23512abff24e79e6f 100644 (file)
@@ -1579,6 +1579,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
     glyph.origin=origin;
     glyph.origin.x+=(FT_Pos) grapheme[i].x_offset;
     glyph.origin.y+=(FT_Pos) grapheme[i].y_offset;
+    glyph.image=0;
     ft_status=FT_Load_Glyph(face,glyph.id,flags);
     if (ft_status != 0)
       continue;
@@ -1766,8 +1767,11 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
     metrics->origin.y=(double) origin.y;
     if (metrics->origin.x > metrics->width)
       metrics->width=metrics->origin.x;
-    if (last_glyph.id != 0)
-      FT_Done_Glyph(last_glyph.image);
+    if (last_glyph.image != 0)
+      {
+        FT_Done_Glyph(last_glyph.image);
+        last_glyph.image=0;
+      }
     last_glyph=glyph;
     code=GetUTFCode(p+grapheme[i].cluster);
   }
@@ -1775,8 +1779,11 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
     grapheme=(GraphemeInfo *) RelinquishMagickMemory(grapheme);
   if (utf8 != (unsigned char *) NULL)
     utf8=(unsigned char *) RelinquishMagickMemory(utf8);
-  if (last_glyph.id != 0)
-    FT_Done_Glyph(last_glyph.image);
+  if (glyph.image != 0)
+    {
+      FT_Done_Glyph(glyph.image);
+      glyph.image=0;
+    }
   /*
     Determine font metrics.
   */
index 2663d5ace9a11c23558ad099183d52f90a79134e..d13c1e975db581ac5e858267999cc6eace156608 100644 (file)
@@ -1809,8 +1809,6 @@ static MagickBooleanType DrawDashPolygon(const DrawInfo *draw_info,
       break;
     if (fabs(length) < MagickEpsilon)
       {
-        if (draw_info->dash_pattern[n] != 0.0)
-          n++;
         if (fabs(draw_info->dash_pattern[n]) < MagickEpsilon)
           n=0;
         length=scale*draw_info->dash_pattern[n];