vulkan: fix crash in ff_vk_shader_free
The issue is if a shader fails to compile, shd->desc_layout would not exist, but nb_descriptor_sets would.
This commit is contained in:
parent
4dc2ae69e7
commit
1029f51285
1 changed files with 6 additions and 4 deletions
|
|
@ -2595,10 +2595,12 @@ void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd)
|
|||
av_free(set->binding_offset);
|
||||
}
|
||||
|
||||
for (int i = 0; i < shd->nb_descriptor_sets; i++)
|
||||
if (shd->desc_layout[i])
|
||||
vk->DestroyDescriptorSetLayout(s->hwctx->act_dev, shd->desc_layout[i],
|
||||
s->hwctx->alloc);
|
||||
if (shd->desc_layout) {
|
||||
for (int i = 0; i < shd->nb_descriptor_sets; i++)
|
||||
if (shd->desc_layout[i])
|
||||
vk->DestroyDescriptorSetLayout(s->hwctx->act_dev, shd->desc_layout[i],
|
||||
s->hwctx->alloc);
|
||||
}
|
||||
|
||||
av_freep(&shd->desc_pool_size);
|
||||
av_freep(&shd->desc_layout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue