From 0da9eb796f846e84c04c7df85e410d485218f358 Mon Sep 17 00:00:00 2001 From: zhaonan287 Date: Wed, 25 Dec 2024 12:40:50 +0800 Subject: [PATCH] Fix multi-btye read heap buffer overflow in stbi__vertical_flip astc-encoder Signed-off-by: zhaonan287 --- Source/stb_image.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/stb_image.h b/Source/stb_image.h index be014b2..05aa3a7 100644 --- a/Source/stb_image.h +++ b/Source/stb_image.h @@ -1447,7 +1447,8 @@ STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int * result = (unsigned char*) stbi__load_gif_main(&s, delays, x, y, z, comp, req_comp); if (stbi__vertically_flip_on_load && result) { - stbi__vertical_flip_slices( result, *x, *y, *z, *comp ); + int channels = req_comp ? req_comp : *comp; + stbi__vertical_flip_slices( result, *x, *y, *z, channels ); } return result; -- Gitee