mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-13 19:05:37 +00:00
lavc/vulkan_video: fix double-free if ff_vk_decode_init() fails
ff_vk_video_common_init() calls ff_vk_video_common_uninit() on failure which leaves dangling object handles. Those get freed again when the destructor of FFVulkanDecodeShared calls ff_vk_video_common_uninit() again. Signed-off-by: Cameron Gutman <aicommander@gmail.com>
This commit is contained in:
parent
a72e01b4ec
commit
4e4677bf58
1 changed files with 6 additions and 2 deletions
|
|
@ -349,17 +349,21 @@ av_cold void ff_vk_video_common_uninit(FFVulkanContext *s,
|
|||
|
||||
av_freep(&common->mem);
|
||||
|
||||
if (common->layered_view)
|
||||
if (common->layered_view) {
|
||||
vk->DestroyImageView(s->hwctx->act_dev, common->layered_view,
|
||||
s->hwctx->alloc);
|
||||
common->layered_view = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
av_frame_free(&common->layered_frame);
|
||||
|
||||
av_buffer_unref(&common->dpb_hwfc_ref);
|
||||
|
||||
if (common->yuv_sampler)
|
||||
if (common->yuv_sampler) {
|
||||
vk->DestroySamplerYcbcrConversion(s->hwctx->act_dev, common->yuv_sampler,
|
||||
s->hwctx->alloc);
|
||||
common->yuv_sampler = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
av_cold int ff_vk_video_common_init(AVCodecContext *avctx, FFVulkanContext *s,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue