This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 4e4677bf586c3fcadad1fed63a6fcf24cda5ddb3
Author:     Cameron Gutman <[email protected]>
AuthorDate: Thu Dec 11 17:39:16 2025 -0600
Commit:     Lynne <[email protected]>
CommitDate: Fri Dec 12 12:43:00 2025 +0000

    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 <[email protected]>
---
 libavcodec/vulkan_video.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index 819940460f..66fc493ff1 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -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,

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to