From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E8DFB470F6 for ; Sat, 26 Aug 2023 21:55:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B1B068C5B0; Sun, 27 Aug 2023 00:55:30 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4846968C49B for ; Sun, 27 Aug 2023 00:55:23 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 9849910600E3 for ; Sat, 26 Aug 2023 21:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1693086923; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=ARuhH1w5AofQbdRnTR+9p0dLgjpSXACqDBR3r/72XdA=; b=OWJA142+NnuQ+4L8duViYguH5rGDfcscIjAPOhHbHX0vhJ9W5FeU1pRBr/0S7X6J MlsajemnBcx+pVw4eqkzlB43pcgXg456hi2VPyFBPd4wza6GyXZ8fTZNy5krYPvT5ZI VOGydhalQBPDuALgo5ifgj0qos/ipIXhnimphmYaz6WV4GubZV3qAdkuuTO0/Juv6Z9 0nTTIOk+jfqbgAgBRFZUpPOqOc+6KsO7G/lbquluJgfS5iOjV7Q+TcUsISiNiQAprFL SSGdku6lWfSDlPshZtpQxZTgjqPMfh13R0k6hc0Xxy+zokzuTgUjZ2wK+MkzFmLzO7G HZccszYMhg== Date: Sat, 26 Aug 2023 23:55:23 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_408816_869545098.1693086923400" Subject: [FFmpeg-devel] [PATCH] vulkan: fix memory leaks 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: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: ------=_Part_408816_869545098.1693086923400 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 9-patch patchset to fix various memory leaks ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0009-vulkan-do-not-leak-bound_buffer_indices.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0009-vulkan-do-not-leak-bound_buffer_indices.patch >From dc6770a375d26eb019002aba6a760fb26c1aa3ba Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:53:03 +0000 Subject: [PATCH 9/9] vulkan: do not leak bound_buffer_indices --- libavutil/vulkan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index 8e36ba508c..c560d79dee 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -1884,6 +1884,7 @@ void ff_vk_pipeline_free(FFVulkanContext *s, FFVulkanPipeline *pl) av_freep(&pl->desc_set); av_freep(&pl->desc_bind); + av_freep(&pl->bound_buffer_indices); av_freep(&pl->push_consts); pl->push_consts_num = 0; } -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0008-lavfi-testsrc_vulkan-fix-memory-leaks.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0008-lavfi-testsrc_vulkan-fix-memory-leaks.patch >From f2d5b11c745541e042f45d1d2ee013760c4b3a1e Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:52:34 +0000 Subject: [PATCH 8/9] lavfi/testsrc_vulkan: fix memory leaks --- libavfilter/vsrc_testsrc_vulkan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vsrc_testsrc_vulkan.c b/libavfilter/vsrc_testsrc_vulkan.c index 8485fa498d..8761c21dfd 100644 --- a/libavfilter/vsrc_testsrc_vulkan.c +++ b/libavfilter/vsrc_testsrc_vulkan.c @@ -189,8 +189,6 @@ static av_cold int init_filter(AVFilterContext *ctx, enum TestSrcVulkanMode mode s->initialized = 1; - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0007-lavfi-transpose_vulkan-fix-memory-leaks.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0007-lavfi-transpose_vulkan-fix-memory-leaks.patch >From 05d83defd515ff5f0189ff526b7a1e17a2f217bb Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:52:22 +0000 Subject: [PATCH 7/9] lavfi/transpose_vulkan: fix memory leaks --- libavfilter/vf_transpose_vulkan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vf_transpose_vulkan.c b/libavfilter/vf_transpose_vulkan.c index 3abe93be0b..c9a520ce5f 100644 --- a/libavfilter/vf_transpose_vulkan.c +++ b/libavfilter/vf_transpose_vulkan.c @@ -121,8 +121,6 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) s->initialized = 1; - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0006-lavfi-scale_vulkan-fix-memory-leaks.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0006-lavfi-scale_vulkan-fix-memory-leaks.patch >From 4df255ed2f5a8ba78cda011c6387fcbe23051f34 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:52:13 +0000 Subject: [PATCH 6/9] lavfi/scale_vulkan: fix memory leaks --- libavfilter/vf_scale_vulkan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index 6699bab934..14f471b819 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -256,8 +256,6 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) s->initialized = 1; - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0005-lavfi-nlmeans_vulkan-fix-memory-leaks.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0005-lavfi-nlmeans_vulkan-fix-memory-leaks.patch >From e19337fa6f9262f1b8fcfd78cb2b691ef0148fe2 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:52:04 +0000 Subject: [PATCH 5/9] lavfi/nlmeans_vulkan: fix memory leaks --- libavfilter/vf_nlmeans_vulkan.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_nlmeans_vulkan.c b/libavfilter/vf_nlmeans_vulkan.c index 7da31b73f5..99f4f867e7 100644 --- a/libavfilter/vf_nlmeans_vulkan.c +++ b/libavfilter/vf_nlmeans_vulkan.c @@ -424,8 +424,6 @@ static av_cold int init_weights_pipeline(FFVulkanContext *vkctx, FFVkExecPool *e RET(ff_vk_init_compute_pipeline(vkctx, pl, shd)); RET(ff_vk_exec_pipeline_register(vkctx, exec, pl)); - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); @@ -570,8 +568,6 @@ static av_cold int init_denoise_pipeline(FFVulkanContext *vkctx, FFVkExecPool *e RET(ff_vk_init_compute_pipeline(vkctx, pl, shd)); RET(ff_vk_exec_pipeline_register(vkctx, exec, pl)); - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); @@ -671,8 +667,6 @@ static av_cold int init_filter(AVFilterContext *ctx) s->initialized = 1; - return 0; - fail: if (spv) spv->uninit(&spv); @@ -1065,6 +1059,9 @@ static void nlmeans_vulkan_uninit(AVFilterContext *avctx) ff_vk_uninit(&s->vkctx); + av_freep(&s->xoffsets); + av_freep(&s->yoffsets); + s->initialized = 0; } -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0004-lavfi-chromaber_vulkan-fix-memory-leaks.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0004-lavfi-chromaber_vulkan-fix-memory-leaks.patch >From abed5158ca26198dc317c486e2a8f7016cfa280d Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:51:55 +0000 Subject: [PATCH 4/9] lavfi/chromaber_vulkan: fix memory leaks --- libavfilter/vf_chromaber_vulkan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vf_chromaber_vulkan.c b/libavfilter/vf_chromaber_vulkan.c index 8b196f149e..0b96a7400f 100644 --- a/libavfilter/vf_chromaber_vulkan.c +++ b/libavfilter/vf_chromaber_vulkan.c @@ -156,8 +156,6 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) s->initialized = 1; - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0003-lavfi-bwdif_vulkan-fix-memory-leaks.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0003-lavfi-bwdif_vulkan-fix-memory-leaks.patch >From 6040135dc00504a4acb1d4ddef3c99c1f7a912d1 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:51:36 +0000 Subject: [PATCH 3/9] lavfi/bwdif_vulkan: fix memory leaks --- libavfilter/vf_bwdif_vulkan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vf_bwdif_vulkan.c b/libavfilter/vf_bwdif_vulkan.c index db916b22cd..f1623e6ef7 100644 --- a/libavfilter/vf_bwdif_vulkan.c +++ b/libavfilter/vf_bwdif_vulkan.c @@ -252,8 +252,6 @@ static av_cold int init_filter(AVFilterContext *ctx) s->initialized = 1; - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0002-lavfi-avgblur_vulkan-fix-memory-leaks.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-lavfi-avgblur_vulkan-fix-memory-leaks.patch >From 2e95eca6893809f547461f62a3180b9fd1a57342 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 21:51:19 +0000 Subject: [PATCH 2/9] lavfi/avgblur_vulkan: fix memory leaks --- libavfilter/vf_avgblur_vulkan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vf_avgblur_vulkan.c b/libavfilter/vf_avgblur_vulkan.c index ae32cd7324..6bc1b616a6 100644 --- a/libavfilter/vf_avgblur_vulkan.c +++ b/libavfilter/vf_avgblur_vulkan.c @@ -153,8 +153,6 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) s->opts.filter_norm[2] = s->opts.filter_norm[0]; s->opts.filter_norm[3] = s->opts.filter_norm[0]; - return 0; - fail: if (spv_opaque) spv->free_shader(spv, &spv_opaque); -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/x-diff; charset=us-ascii; name=0001-vulkan-do-not-leak-cooperative-matrix-properties.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-vulkan-do-not-leak-cooperative-matrix-properties.patch >From 9bc961536561a07665e198f3c68fc5922edb5a2e Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 26 Aug 2023 23:20:47 +0200 Subject: [PATCH 1/9] vulkan: do not leak cooperative matrix properties --- libavutil/vulkan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index 684b92de57..8e36ba508c 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -1893,6 +1893,7 @@ void ff_vk_uninit(FFVulkanContext *s) av_freep(&s->query_props); av_freep(&s->qf_props); av_freep(&s->video_props); + av_freep(&s->coop_mat_props); av_buffer_unref(&s->frames_ref); } -- 2.40.1 ------=_Part_408816_869545098.1693086923400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". ------=_Part_408816_869545098.1693086923400--