]> granicus.if.org Git - imagemagick/commitdiff
Minor refactoring.
authorDirk Lemstra <dirk@lemstra.org>
Tue, 20 Aug 2019 18:16:26 +0000 (20:16 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Tue, 20 Aug 2019 20:04:36 +0000 (22:04 +0200)
coders/png.c

index 4cb97350e1d10f5afa5bceb037ac35a3ef898849..de0e860916bbd93e3e6eefe718e1bf8fde7ba90d 100644 (file)
@@ -8758,14 +8758,16 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
 
   if (ping_preserve_colormap == MagickFalse)
     {
-      if (image->storage_class != PseudoClass && image->colormap != NULL)
+      if ((image->storage_class != PseudoClass) &&
+          (image->colormap != (PixelInfo *) NULL))
         {
           /* Free the bogus colormap; it can cause trouble later */
            if (logging != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
               "    Freeing bogus colormap");
-           (void) RelinquishMagickMemory(image->colormap);
-           image->colormap=NULL;
+           (PixelInfo *) RelinquishMagickMemory(image->colormap);
+           image->colormap=(PixelPacket *) RelinquishMagickMemory(
+             image->colormap);
         }
     }