From 1547c6d84dd0312d6f60b36cb49702c4d26260a9 Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 7 Mar 2018 18:00:59 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6778 --- coders/dcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coders/dcm.c b/coders/dcm.c index 7de8e5f65..8c155c2de 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -2981,6 +2981,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowDCMException(exception,message) \ { \ + if (info.scale != (Quantum *) NULL) \ + info.scale=(Quantum *) RelinquishMagickMemory(info.scale); \ if (data != (unsigned char *) NULL) \ data=(unsigned char *) RelinquishMagickMemory(data); \ if (graymap != (int *) NULL) \ @@ -4037,8 +4039,6 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (stream_info->offsets != (ssize_t *) NULL) stream_info->offsets=(ssize_t *) RelinquishMagickMemory(stream_info->offsets); - if (info.scale != (Quantum *) NULL) - info.scale=(Quantum *) RelinquishMagickMemory(info.scale); ThrowDCMException(CorruptImageError,"ImproperImageHeader"); } stream_info->count=0; -- 2.40.0