From 2bd5d8dcfea247cc4b8e7bd914c972c699b8e5a3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 1 Oct 2017 09:32:15 -0400 Subject: [PATCH] ... --- coders/sun.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coders/sun.c b/coders/sun.c index b485f74ed..50efc0d56 100644 --- a/coders/sun.c +++ b/coders/sun.c @@ -481,7 +481,11 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) { status=DecodeImage(sun_data,sun_info.length,sun_pixels,pixels_length); if (status == MagickFalse) - ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + { + sun_data=(unsigned char *) RelinquishMagickMemory(sun_data); + sun_pixels=(unsigned char *) RelinquishMagickMemory(sun_pixels); + ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + } } else { -- 2.40.0