From a67c15dfa53d72908b0dbe699bb606dd8fc9a0a5 Mon Sep 17 00:00:00 2001 From: jiangjie 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;