From: Cristy Date: Mon, 31 Jul 2017 00:09:18 +0000 (-0400) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32422 X-Git-Tag: 7.0.6-5~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=526397a64a57cd31d68a5678bac7ebf60d1c3029;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32422 --- diff --git a/MagickWand/magick-cli.c b/MagickWand/magick-cli.c index a5915cec8..1c601ede9 100644 --- a/MagickWand/magick-cli.c +++ b/MagickWand/magick-cli.c @@ -816,25 +816,27 @@ Magick_Command_Cleanup: assert(cli_wand->wand.exception == exception); /* Handle metadata for ImageMagickObject COM object for Windows VBS */ - if (metadata != (char **) NULL) { - const char - *format; - - char - *text; - - format="%w,%h,%m"; // Get this from image_info Option splaytree - - text=InterpretImageProperties(image_info,cli_wand->wand.images,format, - exception); - if (text == (char *) NULL) - ThrowMagickException(exception,GetMagickModule(),ResourceLimitError, - "MemoryAllocationFailed","`%s'", GetExceptionMessage(errno)); - else { - (void) ConcatenateString(&(*metadata),text); - text=DestroyString(text); + if ((cli_wand->wand.images != (Image *) NULL) && + (metadata != (char **) NULL)) + { + const char + *format; + + char + *text; + + format="%w,%h,%m"; // Get this from image_info Option splaytree + text=InterpretImageProperties(image_info,cli_wand->wand.images,format, + exception); + if (text == (char *) NULL) + ThrowMagickException(exception,GetMagickModule(),ResourceLimitError, + "MemoryAllocationFailed","`%s'", GetExceptionMessage(errno)); + else + { + (void) ConcatenateString(&(*metadata),text); + text=DestroyString(text); + } } - } Magick_Command_Exit: cli_wand->location="Exiting";