From fdc108373f817d31eab936192e493d9ada9cf633 Mon Sep 17 00:00:00 2001 From: cristy Date: Wed, 23 May 2012 11:48:39 +0000 Subject: [PATCH] --- coders/caption.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ( ; ; ) { -- 2.40.0