Commit e8431d4a2 for imagemagick.org
commit e8431d4a282013851cb698fdf29b1d7ad80ad7cb
Author: Cristy <urban-warrior@imagemagick.org>
Date: Wed May 13 15:51:15 2026 -0400
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-7gg8-qqx7-92g5
diff --git a/coders/miff.c b/coders/miff.c
index 270e3f296..2bb4c85e6 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -1506,6 +1506,11 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
ThrowMIFFException(CorruptImageError,
"UnableToReadImageData");
}
+ if (length == 0)
+ {
+ (void) BZ2_bzDecompressEnd(&bzip_info);
+ ThrowMIFFException(CorruptImageError,"UnexpectedEndOfFile");
+ }
}
code=BZ2_bzDecompress(&bzip_info);
if ((code != BZ_OK) && (code != BZ_STREAM_END))
@@ -1545,6 +1550,11 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
ThrowMIFFException(CorruptImageError,
"UnableToReadImageData");
}
+ if (length == 0)
+ {
+ lzma_end(&lzma_info);
+ ThrowMIFFException(CorruptImageError,"UnexpectedEndOfFile");
+ }
}
code=(int) lzma_code(&lzma_info,LZMA_RUN);
if (code == LZMA_STREAM_END)
@@ -1587,6 +1597,11 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
ThrowMIFFException(CorruptImageError,
"UnableToReadImageData");
}
+ if (length == 0)
+ {
+ (void) inflateEnd(&zip_info);
+ ThrowMIFFException(CorruptImageError,"UnexpectedEndOfFile");
+ }
}
code=inflate(&zip_info,Z_SYNC_FLUSH);
if ((code != Z_OK) && (code != Z_STREAM_END))