[FFmpeg-cvslog] avutil/vulkan: avoid overreads in ff_vk_count_images

Zhao Zhili git at videolan.org
Fri Mar 1 12:11:00 EET 2024


ffmpeg | branch: master | Zhao Zhili <zhilizhao at tencent.com> | Tue Feb 20 20:08:58 2024 +0800| [f6f06fb42ade0518830c54602123582652d53b18] | committer: Zhao Zhili

avutil/vulkan: avoid overreads in ff_vk_count_images

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f6f06fb42ade0518830c54602123582652d53b18
---

 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;



More information about the ffmpeg-cvslog mailing list