diff options
author | IndecisiveTurtle <geoster3d@gmail.com> | 2024-10-05 03:51:42 +0300 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-10-06 01:32:50 +0200 |
commit | d80676117a80e8759c4f2ee44b613d2bf9e27d0b (patch) | |
tree | 5def06fadf4c00466212d1cdafc26b148f1a4bb2 /libavutil | |
parent | 969c271a5a7bd7681a1f775097cf9039f75768f6 (diff) | |
download | ffmpeg-d80676117a80e8759c4f2ee44b613d2bf9e27d0b.tar.gz |
libavutil/vulkan: Prevent crash on shaders with no descriptors
Needed to prevent crashes on vc2 vulkan encoder patch
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/vulkan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index 44552e97b8..cd617496dc 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -2022,7 +2022,7 @@ static inline FFVulkanShaderData *get_shd_data(FFVkExecContext *e, for (int i = 0; i < e->parent->nb_reg_shd; i++) if (e->parent->reg_shd[i].shd == shd) return &e->parent->reg_shd[i]; - av_assert0(0); + return NULL; } static inline void update_set_descriptor(FFVulkanContext *s, FFVkExecContext *e, @@ -2239,7 +2239,7 @@ void ff_vk_exec_bind_shader(FFVulkanContext *s, FFVkExecContext *e, vk->CmdBindPipeline(e->buf, shd->bind_point, shd->pipeline); } - if (sd->nb_descriptor_sets) { + if (sd && sd->nb_descriptor_sets) { if (s->extensions & FF_VK_EXT_DESCRIPTOR_BUFFER) { for (int i = 0; i < sd->nb_descriptor_sets; i++) offsets[i] = shd->desc_set[i].singular ? 0 : shd->desc_set[i].aligned_size*e->idx; |