]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/804
authorCristy <urban-warrior@imagemagick.org>
Sat, 30 Sep 2017 14:24:43 +0000 (10:24 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 30 Sep 2017 14:24:43 +0000 (10:24 -0400)
MagickWand/operation.c

index 2481ca1e9c2536e54935db6eaa5e3ac46c7e57a0..bd3c6c6961566cd197cce6e1260363f746cad953 100644 (file)
@@ -4578,6 +4578,9 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
         if (p == q)
           CLIWandExceptArgBreak(OptionError,"InvalidImageIndex",option,arg1);
         swap=CloneImage(p,0,0,MagickTrue,_exception);
+        if (swap == (Image *) NULL)
+          CLIWandExceptArgBreak(ResourceLimitError,"MemoryAllocationFailed",
+            option,GetExceptionMessage(errno));
         ReplaceImageInList(&p,CloneImage(q,0,0,MagickTrue,_exception));
         ReplaceImageInList(&q,swap);
         _images=GetFirstImageInList(q);