History

libavutil/vulkan: Prevent crash on shaders with no descriptors

Needed to prevent crashes on vc2 vulkan encoder patch

IndecisiveTurtle committed 2 years ago

Commit d8067611 parent 969c2711 file · +2 −2Browse files

Unified · Split

libavutil/vulkan.c+2−2
@@ -2022,7 +2022,7 @@ static inline FFVulkanShaderData *get_shd_data(FFVkExecContext *e, · 2021 unmodified lines
20222022 for (int i = 0; i < e->parent->nb_reg_shd; i++)
20232023 if (e->parent->reg_shd[i].shd == shd)
20242024 return &e->parent->reg_shd[i];
2025− av_assert0(0);
2025+ return NULL;
20262026 }
20272027
20282028 static inline void update_set_descriptor(FFVulkanContext *s, FFVkExecContext *e,
@@ -2239,7 +2239,7 @@ void ff_vk_exec_bind_shader(FFVulkanContext *s, FFVkExecContext *e, · 210 unmodified lines
22392239 vk->CmdBindPipeline(e->buf, shd->bind_point, shd->pipeline);
22402240 }
22412241
2242− if (sd->nb_descriptor_sets) {
2242+ if (sd && sd->nb_descriptor_sets) {
22432243 if (s->extensions & FF_VK_EXT_DESCRIPTOR_BUFFER) {
22442244 for (int i = 0; i < sd->nb_descriptor_sets; i++)
22452245 offsets[i] = shd->desc_set[i].singular ? 0 : shd->desc_set[i].aligned_size*e->idx;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t