mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
e6ecc1e757
commit
f5e2914a89
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue