]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 23 May 2012 11:48:39 +0000 (11:48 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 23 May 2012 11:48:39 +0000 (11:48 +0000)
coders/caption.c

index a7f3fb06a1cc66201155a31aad783232cb96048e..bcae0d6e0d87130d0b9510d5366fbf5526e3851d 100644 (file)
@@ -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 ( ; ; )
       {