]> granicus.if.org Git - imagemagick/commitdiff
Fixed memory leak.
authorDirk Lemstra <dirk@git.imagemagick.org>
Thu, 18 Jan 2018 20:05:31 +0000 (21:05 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Thu, 18 Jan 2018 20:05:31 +0000 (21:05 +0100)
Credit to OSS-Fuzz

MagickCore/compress.c

index 33160220f379d3e5804b937c9f14f16949d18d1e..5f4bd81172bb2824dc5bb7e7639b95b0046b580e 100644 (file)
@@ -460,9 +460,9 @@ MagickExport MagickBooleanType HuffmanDecodeImage(Image *image,
       (scanline == (unsigned char *) NULL))
     {
       if (mb_hash != (HuffmanTable **) NULL)
-        mw_hash=(HuffmanTable **) RelinquishMagickMemory(mw_hash);
-      if (mw_hash != (HuffmanTable **) NULL)
         mb_hash=(HuffmanTable **) RelinquishMagickMemory(mb_hash);
+      if (mw_hash != (HuffmanTable **) NULL)
+        mw_hash=(HuffmanTable **) RelinquishMagickMemory(mw_hash);
       if (scanline != (unsigned char *) NULL)
         scanline=(unsigned char *) RelinquishMagickMemory(scanline);
       ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",