avutil/vulkan: avoid overreads in ff_vk_count_images

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
release/7.0
Zhao Zhili 9 months ago
parent 03275b0f09
commit f6f06fb42a
  1. 2
      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;

Loading…
Cancel
Save