PR #22783 opened by Niklas Haas (haasn)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22783
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22783.patch

Fixes a memory leak caused by AV_MEDIA_TYPE_VIDEO == 0 being excluded by
the !pool->type check. We can just remove the entire check because
av_buffer_pool_uninit() is already safe on NULL.

Fixes: fe2691b3bbe3e0cedc37f01a87e49a166d7bf917
Reported-by: Kacper Michajłow <[email protected]>
Signed-off-by: Niklas Haas <[email protected]>


From ef13a29d086d74e7fdf5eeaf6283564c257ee81f Mon Sep 17 00:00:00 2001
From: Niklas Haas <[email protected]>
Date: Fri, 10 Apr 2026 21:58:24 +0200
Subject: [PATCH] avfilter/framepool: fix frame pool uninit check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes a memory leak caused by AV_MEDIA_TYPE_VIDEO == 0 being excluded by
the !pool->type check. We can just remove the entire check because
av_buffer_pool_uninit() is already safe on NULL.

Fixes: fe2691b3bbe3e0cedc37f01a87e49a166d7bf917
Reported-by: Kacper Michajłow <[email protected]>
Signed-off-by: Niklas Haas <[email protected]>
---
 libavfilter/framepool.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c
index fe06549789..20dbb342b6 100644
--- a/libavfilter/framepool.c
+++ b/libavfilter/framepool.c
@@ -214,9 +214,6 @@ fail:
 
 av_cold void ff_frame_pool_uninit(FFFramePool *pool)
 {
-    if (!pool->type)
-        return;
-
     for (int i = 0; i < 4; i++)
         av_buffer_pool_uninit(&pool->pools[i]);
 
-- 
2.52.0

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

Reply via email to