From 12f34b60564de1cbec08e23e2413dab5b64daeb7 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 30 Sep 2017 10:15:29 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/802 --- MagickWand/mogrify.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index b8275399c..813e35df6 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -8791,6 +8791,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, if (p == q) break; swap=CloneImage(p,0,0,MagickTrue,exception); + if (swap == (Image *) NULL) + ThrowWandFatalException(ResourceLimitFatalError, + "MemoryAllocationFailed",(*images)->filename); ReplaceImageInList(&p,CloneImage(q,0,0,MagickTrue,exception)); ReplaceImageInList(&q,swap); *images=GetFirstImageInList(q); -- 2.40.0