From 3846f7cb6fd8c8fa216602b8a34cf0f888f71044 Mon Sep 17 00:00:00 2001 From: Nia Bickford Date: Tue, 25 Nov 2025 00:33:39 -0800 Subject: [PATCH] Additional safety check inside stbi__convert_8_to_16, which looks like it could run into a similar issue --- stb_image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_image.h b/stb_image.h index b7c11ba02..8f915a77a 100644 --- a/stb_image.h +++ b/stb_image.h @@ -1209,7 +1209,7 @@ static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int chan int img_len = w * h * channels; stbi__uint16 *enlarged; - enlarged = (stbi__uint16 *) stbi__malloc(img_len*2); + enlarged = (stbi__uint16 *) stbi__malloc_mad2(img_len, 2, 0); if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); for (i = 0; i < img_len; ++i)