]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/773
authorCristy <urban-warrior@imagemagick.org>
Fri, 22 Sep 2017 13:15:49 +0000 (09:15 -0400)
committerCristy <urban-warrior@imagemagick.org>
Fri, 22 Sep 2017 13:15:49 +0000 (09:15 -0400)
coders/png.c

index d93193407c01f0f83d523cad4bf7a5ade8ef4eb6..d3027c8502572da8ed29fcaa2fdc88ff89fef474 100644 (file)
@@ -4339,22 +4339,22 @@ DestroyJNG(unsigned char *chunk,Image **color_image,
   ImageInfo **alpha_image_info)
 {
   (void) RelinquishMagickMemory(chunk);
-  if (*color_image_info)
+  if (color_image_info && *color_image_info)
   {
     DestroyImageInfo(*color_image_info);
     *color_image_info = (ImageInfo *)NULL;
   }
-  if (*alpha_image_info)
+  if (alpha_image_info && *alpha_image_info)
   {
     DestroyImageInfo(*alpha_image_info);
     *alpha_image_info = (ImageInfo *)NULL;
   }
-  if (*color_image)
+  if (color_image && *color_image)
   {
     DestroyImage(*color_image);
     *color_image = (Image *)NULL;
   }
-  if (*alpha_image)
+  if (alpha_image && *alpha_image)
   {
     DestroyImage(*alpha_image);
     *alpha_image = (Image *)NULL;