From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id C06D04C23E for ; Fri, 1 Aug 2025 11:24:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 2110E68CBB5; Fri, 1 Aug 2025 14:24:01 +0300 (EEST) Received: from mail-4325.protonmail.ch (mail-4325.protonmail.ch [185.70.43.25]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 401F968B5DF for ; Fri, 1 Aug 2025 14:23:54 +0300 (EEST) Date: Fri, 01 Aug 2025 11:23:48 +0000 To: ffmpeg-devel@ffmpeg.org Message-ID: <20250801112341.986117-1-VytskaLT@protonmail.com> Feedback-ID: 28638248:user:proton X-Pm-Message-ID: 185adac75f229f743456cdee78fe8b3629b6b6c5 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] hwcontext_vulkan: fix memory leak in drm->vulkan mapping X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: vytskalt via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: vytskalt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: vytskalt If ff_vk_exec_discard_deps is not called after ff_vk_exec_add_dep_frame we get a reference cycle causing the frames context to never be freed. Same situation as in 74e27d9e3182d2d256d11bb0d5d45633b054bbcb Signed-off-by: vytskalt --- libavutil/hwcontext_vulkan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 6d7df3e619..f0b0dcd0a4 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -3426,8 +3426,12 @@ static int vulkan_map_from_drm_frame_sync(AVHWFramesContext *hwfc, AVFrame *dst, }); err = ff_vk_exec_submit(&p->vkctx, exec); - if (err < 0) + if (err < 0) { + ff_vk_exec_discard_deps(&p->vkctx, exec); return err; + } + + ff_vk_exec_wait(&p->vkctx, exec); } else #endif { -- 2.49.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".