1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

libavutil/vulkan: fix flexible array struct allocation

The flexible array member struct can have padding added by
the compiler which was not taken into account properly, which
could lead to a heap buffer overflow.
This commit is contained in:
Marvin Scholz 2024-10-09 02:12:39 +02:00 committed by Lynne
parent e6ecc1e757
commit f5e2914a89

View File

@ -646,7 +646,7 @@ int ff_vk_exec_add_dep_bool_sem(FFVulkanContext *s, FFVkExecContext *e,
return 0;
}
buf_size = sizeof(int) + sizeof(VkSemaphore)*nb;
buf_size = sizeof(*ts) + sizeof(VkSemaphore)*nb;
ts = av_mallocz(buf_size);
if (!ts) {
err = AVERROR(ENOMEM);