From 45c32de9a65d39d6c35b416eda5b7ea353fa3d6d Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 3 Apr 2018 19:50:58 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7331 --- coders/dng.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/coders/dng.c b/coders/dng.c index c306a6611..f467476fd 100644 --- a/coders/dng.c +++ b/coders/dng.c @@ -285,6 +285,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) { (void) ThrowMagickException(exception,GetMagickModule(),CoderError, libraw_strerror(errcode),"`%s'",image->filename); + libraw_close(raw_info); return(DestroyImageList(image)); } #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_MSC_VER) && (_MSC_VER > 1310) @@ -391,7 +392,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Set DNG image metadata. */ - if (raw_info->color.profile) + if (raw_info->color.profile != NULL) { profile=BlobToStringInfo(raw_info->color.profile, raw_info->color.profile_length); @@ -402,7 +403,7 @@ static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) } } #if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,18) - if (raw_info->idata.xmpdata) + if (raw_info->idata.xmpdata != NULL) { profile=BlobToStringInfo(raw_info->idata.xmpdata, raw_info->idata.xmplen); -- 2.50.1