From d010f03a3c57f0183673ae553ae1d73c9ef84d72 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 1 Apr 2018 08:40:34 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7261 --- coders/miff.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coders/miff.c b/coders/miff.c index 2ca7c91c6..3a903fd9b 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -1593,10 +1593,11 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, MagickOffsetType offset; - offset=SeekBlob(image,-((MagickOffsetType) - bzip_info.avail_in),SEEK_CUR); + offset=SeekBlob(image,-((MagickOffsetType) bzip_info.avail_in), + SEEK_CUR); if (offset < 0) { + (void) BZ2_bzDecompressEnd(&bzip_info); quantum_info=DestroyQuantumInfo(quantum_info); compress_pixels=(unsigned char *) RelinquishMagickMemory( compress_pixels); @@ -1638,6 +1639,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, SEEK_CUR); if (offset < 0) { + (void) inflateEnd(&zip_info); quantum_info=DestroyQuantumInfo(quantum_info); compress_pixels=(unsigned char *) RelinquishMagickMemory( compress_pixels); -- 2.40.0