From: Cristy Date: Thu, 8 Feb 2018 12:14:27 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6100 X-Git-Tag: 7.0.7-23~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efe60cdeea6d4edb9f7827d68c70e4a53ef3f9dd;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6100 --- 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);