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
2595 av_free(set->binding_offset);2595 av_free(set->binding_offset);
2596 }2596 }
2597 2597
2598 for (int i = 0; i < shd->nb_descriptor_sets; i++)2598 if (shd->desc_layout) {
2599 if (shd->desc_layout[i])2599 for (int i = 0; i < shd->nb_descriptor_sets; i++)
2600 vk->DestroyDescriptorSetLayout(s->hwctx->act_dev, shd->desc_layout[i],2600 if (shd->desc_layout[i])
2601 s->hwctx->alloc);2601 vk->DestroyDescriptorSetLayout(s->hwctx->act_dev, shd->desc_layout[i],
2602 s->hwctx->alloc);
2603 }
2602 2604
2603 av_freep(&shd->desc_pool_size);2605 av_freep(&shd->desc_pool_size);
2604 av_freep(&shd->desc_layout);2606 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