From f6f06fb42ade0518830c54602123582652d53b18 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Tue, 20 Feb 2024 20:08:58 +0800 Subject: [PATCH] avutil/vulkan: avoid overreads in ff_vk_count_images Signed-off-by: Zhao Zhili --- libavutil/vulkan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index b666841836..a5e78760d7 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -271,7 +271,7 @@ typedef struct FFVulkanContext { static inline int ff_vk_count_images(AVVkFrame *f) { int cnt = 0; - while (f->img[cnt]) + while (cnt < FF_ARRAY_ELEMS(f->img) && f->img[cnt]) cnt++; return cnt;