Commit b2dc602e1 for imagemagick.org
commit b2dc602e175ee07b0794f3e31f1a29ae6b7267d1
Author: Cristy <urban-warrior@imagemagick.org>
Date: Fri Jun 5 09:41:48 2026 -0400
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-r628-69v2-2f9c
diff --git a/coders/miff.c b/coders/miff.c
index 2bb4c85e6..c58546f72 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -2208,7 +2208,10 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
compress_pixels=(unsigned char *) AcquireQuantumMemory(length,
sizeof(*compress_pixels));
if (compress_pixels == (unsigned char *) NULL)
- ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ }
/*
Write MIFF header.
*/
@@ -2503,7 +2506,10 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
colormap=(unsigned char *) AcquireQuantumMemory(image->colors,
colormap_size*sizeof(*colormap));
if (colormap == (unsigned char *) NULL)
- ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ }
/*
Write colormap to file.
*/