PR #23062 opened by jiangjie
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23062
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23062.patch

Fix by using goto fail so that vulkan_frame_free() properly cleans up
all previously created resources.


>From e340ea45aa0698356ee6ca16b978b82807326c49 Mon Sep 17 00:00:00 2001
From: jiangjie <[email protected]>
Date: Sun, 10 May 2026 17:14:19 +0800
Subject: [PATCH] avutil/hwcontext_vulkan: fix resource leak on alloc_mem
 failure

Fix by using goto fail so that vulkan_frame_free() properly cleans up
all previously created resources.
---
 libavutil/hwcontext_vulkan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 7fb998b01d..ff0eeb60eb 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3568,7 +3568,7 @@ static int 
vulkan_map_from_drm_frame_desc(AVHWFramesContext *hwfc, AVVkFrame **f
                         &f->flags, &f->mem[i]);
         if (err) {
             close(idesc.fd);
-            return err;
+            goto fail;
         }
 
         f->size[i] = req2.memoryRequirements.size;
-- 
2.52.0

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

Reply via email to