Commit 538ad18f3 for imagemagick.org
commit 538ad18f3a421d1dd9629baa747eebc137c32b67
Author: Cristy <urban-warrior@imagemagick.org>
Date: Sat Jun 27 12:11:40 2026 -0400
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-h22j-f9xw-xjjm
diff --git a/coders/jnx.c b/coders/jnx.c
index b08db289a..a2c173bd3 100644
--- a/coders/jnx.c
+++ b/coders/jnx.c
@@ -284,6 +284,11 @@ static Image *ReadJNXImage(const ImageInfo *image_info,ExceptionInfo *exception)
images=DestroyImageList(images);
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
}
+ if (tile_length > (UINT_MAX-2))
+ {
+ images=DestroyImageList(images);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
blob=(unsigned char *) AcquireQuantumMemory((size_t) tile_length+2,
sizeof(*blob));
if (blob == (unsigned char *) NULL)