]> granicus.if.org Git - imagemagick/commitdiff
Removed duplicate call to GetMultilineTypeMetrics.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sat, 17 Mar 2018 13:09:26 +0000 (14:09 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sat, 17 Mar 2018 13:09:55 +0000 (14:09 +0100)
coders/label.c

index 97871fbd588c8953a41fb5f3aed354a3c09aee08..e557ea134bd40d578eac1d01c597e964e9b0da62 100644 (file)
@@ -145,7 +145,7 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
       image->rows=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
     }
   else
-    if ((strlen(label) > 0) &&
+    if ((status != MagickFalse) && (strlen(label) > 0) &&
         (((image->columns == 0) || (image->rows == 0)) ||
          (fabs(image_info->pointsize) < MagickEpsilon)))
       {
@@ -180,6 +180,12 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
                 ((image->rows != 0) && (height >= image->rows)))
               break;
         }
+        if (status == MagickFalse)
+          {
+            draw_info=DestroyDrawInfo(draw_info);
+            image=DestroyImageList(image);
+            return((Image *) NULL);
+          }
         high=draw_info->pointsize;
         for (low=1.0; (high-low) > 0.5; )
         {
@@ -207,9 +213,12 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
             else
               high=draw_info->pointsize-0.5;
         }
-        draw_info->pointsize=(low+high)/2.0-0.5;
+        if (status != MagickFalse)
+          {
+            draw_info->pointsize=(low+high)/2.0-0.5;
+            status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
+          }
       }
-   status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
    if (status == MagickFalse)
      {
        draw_info=DestroyDrawInfo(draw_info);