From: Dirk Lemstra Date: Sat, 17 Mar 2018 13:09:26 +0000 (+0100) Subject: Removed duplicate call to GetMultilineTypeMetrics. X-Git-Tag: 7.0.7-27~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d6a118a1404412e25443230892deadf59565aa3;p=imagemagick Removed duplicate call to GetMultilineTypeMetrics. --- diff --git a/coders/label.c b/coders/label.c index 97871fbd5..e557ea134 100644 --- a/coders/label.c +++ b/coders/label.c @@ -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);