From: cristy Date: Wed, 23 May 2012 11:48:39 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5548 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdc108373f817d31eab936192e493d9ada9cf633;p=imagemagick --- diff --git a/coders/caption.c b/coders/caption.c index a7f3fb06a..bcae0d6e0 100644 --- a/coders/caption.c +++ b/coders/caption.c @@ -162,7 +162,7 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, *text; /* - Scale text to fit bounding box height. + Scale text up to fit bounding box. */ for ( ; ; ) { @@ -179,13 +179,13 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info, (void) status; width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5); height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); - if (height > image->rows) + if ((width > image->columns) || (height > image->rows)) break; draw_info->pointsize*=2.0; } draw_info->pointsize/=2.0; /* - Scale text to fit bounding box. + Scale text down to fit bounding box. */ for ( ; ; ) {