]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7331
authorCristy <urban-warrior@imagemagick.org>
Tue, 3 Apr 2018 23:50:58 +0000 (19:50 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 3 Apr 2018 23:50:58 +0000 (19:50 -0400)
coders/dng.c

index c306a661188879939318dc1e868fc0b4bf6d6de6..f467476fd8b3a10922a5fbe8119f1913cafc85fb 100644 (file)
@@ -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);