]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6100
authorCristy <urban-warrior@imagemagick.org>
Thu, 8 Feb 2018 12:14:27 +0000 (07:14 -0500)
committerCristy <urban-warrior@imagemagick.org>
Thu, 8 Feb 2018 12:14:27 +0000 (07:14 -0500)
coders/caption.c
coders/label.c

index 3dc16636e5ccf61d56c14d41edaffd577e4d1005..e0cc5fc54135cb14493b9821e35dba91132cd175 100644 (file)
@@ -134,6 +134,9 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickCoreSignature);
   image=AcquireImage(image_info,exception);
+  image->columns=1;
+  image->rows=1;
+  (void) SetImageBackgroundColor(image,exception);
   (void) ResetImagePage(image,"0x0+0+0");
   /*
     Format caption.
@@ -149,6 +152,9 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
     else
       property=InterpretImageProperties((ImageInfo *) image_info,image,option,
         exception);
+  image=DestroyImage(image);
+  image=AcquireImage(image_info,exception);
+  (void) ResetImagePage(image,"0x0+0+0");
   (void) SetImageProperty(image,"caption",property,exception);
   property=DestroyString(property);
   caption=ConstantString(GetImageProperty(image,"caption",exception));
index 60d00e3ff2bb6151cd09a31c8ad3ca31751c045a..c1567b00a21a90a48cb6df9277f95f6415b3f6e5 100644 (file)
@@ -123,9 +123,15 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickCoreSignature);
   image=AcquireImage(image_info,exception);
+  image->columns=1;
+  image->rows=1;
+  (void) SetImageBackgroundColor(image,exception);
   (void) ResetImagePage(image,"0x0+0+0");
   property=InterpretImageProperties((ImageInfo *) image_info,image,
     image_info->filename,exception);
+  image=DestroyImage(image);
+  image=AcquireImage(image_info,exception);
+  (void) ResetImagePage(image,"0x0+0+0");
   (void) SetImageProperty(image,"label",property,exception);
   property=DestroyString(property);
   label=GetImageProperty(image,"label",exception);