From 875044bb78e52722940ef446be2f1f130f1aca9e Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 22 Sep 2017 09:05:14 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/774 --- MagickCore/morphology.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c index 14d8ec154..25c4ad67e 100644 --- a/MagickCore/morphology.c +++ b/MagickCore/morphology.c @@ -2334,16 +2334,22 @@ static void ExpandMirrorKernelInfo(KernelInfo *kernel) last = kernel; clone = CloneKernelInfo(last); + if (clone == (KernelInfo *) NULL) + return; RotateKernelInfo(clone, 180); /* flip */ LastKernelInfo(last)->next = clone; last = clone; clone = CloneKernelInfo(last); + if (clone == (KernelInfo *) NULL) + return; RotateKernelInfo(clone, 90); /* transpose */ LastKernelInfo(last)->next = clone; last = clone; clone = CloneKernelInfo(last); + if (clone == (KernelInfo *) NULL) + return; RotateKernelInfo(clone, 180); /* flop */ LastKernelInfo(last)->next = clone; -- 2.40.0