From f2d9f5a0140f093da9c26d8104de0d93d7ea6716 Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 14 Mar 2018 20:23:35 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6876 --- coders/dcm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/coders/dcm.c b/coders/dcm.c index ebace2e68..34f796189 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3881,11 +3881,21 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) } (void) RelinquishUniqueFileResource(filename); } + read_info=DestroyImageInfo(read_info); if (stream_info->offsets != (ssize_t *) NULL) stream_info->offsets=(ssize_t *) RelinquishMagickMemory(stream_info->offsets); stream_info=(DCMStreamInfo *) RelinquishMagickMemory(stream_info); - read_info=DestroyImageInfo(read_info); + if (info.scale != (Quantum *) NULL) + info.scale=(Quantum *) RelinquishMagickMemory(info.scale); + if (graymap != (int *) NULL) + graymap=(int *) RelinquishMagickMemory(graymap); + if (bluemap != (int *) NULL) + bluemap=(int *) RelinquishMagickMemory(bluemap); + if (greenmap != (int *) NULL) + greenmap=(int *) RelinquishMagickMemory(greenmap); + if (redmap != (int *) NULL) + redmap=(int *) RelinquishMagickMemory(redmap); image=DestroyImage(image); return(GetFirstImageInList(images)); } -- 2.40.0