From efe60cdeea6d4edb9f7827d68c70e4a53ef3f9dd Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 8 Feb 2018 07:14:27 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6100 --- coders/caption.c | 6 ++++++ coders/label.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/coders/caption.c b/coders/caption.c index 3dc16636e..e0cc5fc54 100644 --- a/coders/caption.c +++ b/coders/caption.c @@ -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)); diff --git a/coders/label.c b/coders/label.c index 60d00e3ff..c1567b00a 100644 --- a/coders/label.c +++ b/coders/label.c @@ -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); -- 2.40.0