From: Cristy Date: Tue, 3 Apr 2018 23:50:58 +0000 (-0400) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7331 X-Git-Tag: 7.0.7-29~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45c32de9a65d39d6c35b416eda5b7ea353fa3d6d;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7331 --- 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);