]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32422
authorCristy <urban-warrior@imagemagick.org>
Mon, 31 Jul 2017 00:09:18 +0000 (20:09 -0400)
committerCristy <urban-warrior@imagemagick.org>
Mon, 31 Jul 2017 00:09:18 +0000 (20:09 -0400)
MagickWand/magick-cli.c

index a5915cec8ddfd969267337e8d828714cd53d1226..1c601ede9a96d16201d336fd5df623566c486828 100644 (file)
@@ -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";