[FFmpeg-cvslog] avutil/hwcontext_vulkan: Fix memleaks when transfer to vulkan

Zhao Zhili git at videolan.org
Fri Mar 1 12:11:03 EET 2024


ffmpeg | branch: master | Zhao Zhili <zhilizhao at tencent.com> | Tue Feb 20 22:27:04 2024 +0800| [74e27d9e3182d2d256d11bb0d5d45633b054bbcb] | committer: Zhao Zhili

avutil/hwcontext_vulkan: Fix memleaks when transfer to vulkan

Without ff_vk_exec_discard_deps which is called by ff_vk_exec_wait,
the reference count of hwframe context cannot reach zero due to
circular reference created by ff_vk_exec_add_dep_frame.

Fix #10873

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74e27d9e3182d2d256d11bb0d5d45633b054bbcb
---

 libavutil/hwcontext_vulkan.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 818ebac2d1..0bf1c22862 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3394,9 +3394,7 @@ static int transfer_image_buf(AVHWFramesContext *hwfc, AVFrame *f,
     if (err < 0)
         return err;
 
-    /* Wait for the operation to complete when downloading */
-    if (to_buf)
-        ff_vk_exec_wait(&p->vkctx, exec);
+    ff_vk_exec_wait(&p->vkctx, exec);
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list