From 526397a64a57cd31d68a5678bac7ebf60d1c3029 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 30 Jul 2017 20:09:18 -0400 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32422 --- MagickWand/magick-cli.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) 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"; -- 2.40.0