9-patch patchset to fix various memory leaks

>From dc6770a375d26eb019002aba6a760fb26c1aa3ba Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From f2d5b11c745541e042f45d1d2ee013760c4b3a1e Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From 05d83defd515ff5f0189ff526b7a1e17a2f217bb Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From 4df255ed2f5a8ba78cda011c6387fcbe23051f34 Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From e19337fa6f9262f1b8fcfd78cb2b691ef0148fe2 Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From abed5158ca26198dc317c486e2a8f7016cfa280d Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From 6040135dc00504a4acb1d4ddef3c99c1f7a912d1 Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From 2e95eca6893809f547461f62a3180b9fd1a57342 Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

>From 9bc961536561a07665e198f3c68fc5922edb5a2e Mon Sep 17 00:00:00 2001
From: Lynne <d...@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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to