History

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.

Lynne committed 1 year ago

Commit 1029f511 parent 4dc2ae61 file · +6 −4Browse files

Unified · Split

libavutil/vulkan.c+6−4
@@ -2595,10 +2595,12 @@ void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd) · 2594 unmodified lines
25952595 av_free(set->binding_offset);
25962596 }
25972597
2598− for (int i = 0; i < shd->nb_descriptor_sets; i++)
2599− if (shd->desc_layout[i])
2600− vk->DestroyDescriptorSetLayout(s->hwctx->act_dev, shd->desc_layout[i],
2601− s->hwctx->alloc);
2598+ if (shd->desc_layout) {
2599+ for (int i = 0; i < shd->nb_descriptor_sets; i++)
2600+ if (shd->desc_layout[i])
2601+ vk->DestroyDescriptorSetLayout(s->hwctx->act_dev, shd->desc_layout[i],
2602+ s->hwctx->alloc);
2603+ }
26022604
26032605 av_freep(&shd->desc_pool_size);
26042606 av_freep(&shd->desc_layout);

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