[FFmpeg-cvslog] lavfi/nlmeans_vulkan: fix memory leaks

Lynne git at videolan.org
Mon Aug 28 23:33:10 EEST 2023


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Sat Aug 26 21:52:04 2023 +0000| [0f2ae1ba6939a1dede0cf02e43daf50218416093] | committer: Lynne

lavfi/nlmeans_vulkan: fix memory leaks

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f2ae1ba6939a1dede0cf02e43daf50218416093
---

 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;
 }
 



More information about the ffmpeg-cvslog mailing list