From: Lynne <dev@lynne.ee> To: Ffmpeg Devel <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] vulkan: fix memory leaks Date: Sat, 26 Aug 2023 23:55:23 +0200 (CEST) Message-ID: <Ncnq2Xn--3-9@lynne.ee> (raw) [-- Attachment #1: Type: text/plain, Size: 46 bytes --] 9-patch patchset to fix various memory leaks [-- Attachment #2: 0009-vulkan-do-not-leak-bound_buffer_indices.patch --] [-- Type: text/x-diff, Size: 673 bytes --] From dc6770a375d26eb019002aba6a760fb26c1aa3ba Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #3: 0008-lavfi-testsrc_vulkan-fix-memory-leaks.patch --] [-- Type: text/x-diff, Size: 707 bytes --] From f2d5b11c745541e042f45d1d2ee013760c4b3a1e Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #4: 0007-lavfi-transpose_vulkan-fix-memory-leaks.patch --] [-- Type: text/x-diff, Size: 694 bytes --] From 05d83defd515ff5f0189ff526b7a1e17a2f217bb Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #5: 0006-lavfi-scale_vulkan-fix-memory-leaks.patch --] [-- Type: text/x-diff, Size: 670 bytes --] From 4df255ed2f5a8ba78cda011c6387fcbe23051f34 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #6: 0005-lavfi-nlmeans_vulkan-fix-memory-leaks.patch --] [-- Type: text/x-diff, Size: 1483 bytes --] From e19337fa6f9262f1b8fcfd78cb2b691ef0148fe2 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #7: 0004-lavfi-chromaber_vulkan-fix-memory-leaks.patch --] [-- Type: text/x-diff, Size: 694 bytes --] From abed5158ca26198dc317c486e2a8f7016cfa280d Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #8: 0003-lavfi-bwdif_vulkan-fix-memory-leaks.patch --] [-- Type: text/x-diff, Size: 657 bytes --] From 6040135dc00504a4acb1d4ddef3c99c1f7a912d1 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #9: 0002-lavfi-avgblur_vulkan-fix-memory-leaks.patch --] [-- Type: text/x-diff, Size: 763 bytes --] From 2e95eca6893809f547461f62a3180b9fd1a57342 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #10: 0001-vulkan-do-not-leak-cooperative-matrix-properties.patch --] [-- Type: text/x-diff, Size: 653 bytes --] From 9bc961536561a07665e198f3c68fc5922edb5a2e Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> 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 [-- Attachment #11: Type: text/plain, Size: 251 bytes --] _______________________________________________ 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".
next reply other threads:[~2023-08-26 21:55 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-08-26 21:55 Lynne [this message] [not found] ` <Ncnq2Xn--3-9@lynne.ee-Ncnq6FQ----9> 2023-08-28 20:33 ` Lynne
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=Ncnq2Xn--3-9@lynne.ee \ --to=dev@lynne.ee \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git