PR #24864 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24864
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24864.patch

Fixes: memory leak
Found during review of the security report H4m9FuNqTLv6



>From 02c698fea9c3ae31c14dc3ddf4c25a8f9f746206 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Sat, 3 Oct 2026 19:09:04 +0200
Subject: [PATCH] avfilter/vf_minterpolate: free the sub-blocks of all 4
 sub-blocks

Fixes: memory leak
Found during review of the security report H4m9FuNqTLv6
---
 libavfilter/vf_minterpolate.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c
index fa63dc4a37..c996713553 100644
--- a/libavfilter/vf_minterpolate.c
+++ b/libavfilter/vf_minterpolate.c
@@ -1208,12 +1208,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*avf_in)
     return 0;
 }
 
-static av_cold void free_blocks(Block *block, int sb)
+static av_cold void free_blocks(Block *block)
 {
     if (block->subs)
-        free_blocks(block->subs, 1);
-    if (sb)
-        av_freep(&block);
+        for (int i = 0; i < 4; i++)
+            free_blocks(&block->subs[i]);
+    av_freep(&block->subs);
 }
 
 static av_cold void uninit(AVFilterContext *ctx)
@@ -1226,7 +1226,7 @@ static av_cold void uninit(AVFilterContext *ctx)
     av_freep(&mi_ctx->pixel_refs);
     if (mi_ctx->int_blocks)
         for (m = 0; m < mi_ctx->b_count; m++)
-            free_blocks(&mi_ctx->int_blocks[m], 0);
+            free_blocks(&mi_ctx->int_blocks[m]);
     av_freep(&mi_ctx->int_blocks);
 
     for (i = 0; i < NB_FRAMES; i++) {
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to