From 005957289b1129aeb7daa55407d30b0b95767cf7 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 29 Sep 2017 07:06:36 -0400 Subject: [PATCH] ... --- coders/raw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coders/raw.c b/coders/raw.c index 78a638fd5..d6fe296b1 100644 --- a/coders/raw.c +++ b/coders/raw.c @@ -159,7 +159,10 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum_type=GrayQuantum; quantum_info=AcquireQuantumInfo(image_info,canvas_image); if (quantum_info == (QuantumInfo *) NULL) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + { + canvas_image=DestroyImage(canvas_image); + ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + } pixels=(const unsigned char *) NULL; if (image_info->number_scenes != 0) while (image->scene < image_info->scene) -- 2.40.0