]> granicus.if.org Git - imagemagick/commitdiff
Fixed incorrect call to WriteBlob reported in #490.
authorDirk Lemstra <dirk@git.imagemagick.org>
Mon, 15 May 2017 19:18:13 +0000 (21:18 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Mon, 15 May 2017 19:18:13 +0000 (21:18 +0200)
coders/png.c

index c194d08585cf95ab11d7881523f0e892cb26240f..cfd68440066328997e1a11b3ff2ad178dbc748bc 100644 (file)
@@ -4782,10 +4782,11 @@ static Image *ReadOneJNGImage(MngInfo *mng_info,
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "    Copying JDAT chunk data to color_blob.");
 
-        (void) WriteBlob(color_image,length,chunk);
-
         if (length != 0)
-          chunk=(unsigned char *) RelinquishMagickMemory(chunk);
+          {
+            (void) WriteBlob(color_image,length,chunk);
+            chunk=(unsigned char *) RelinquishMagickMemory(chunk);
+          }
 
         continue;
       }