From a0510f7f7299f2cab90ca93fc668bd593791a169 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 24 Mar 2026 18:10:17 +0100 Subject: [PATCH] avfilter/framepool: update frame dimensions on reinit The previous logic (ported from libavfilter/video.c) would leave the frame pool intact if the linesize did not change as a result of changing the frame dimensions. However, this caused ff_default_get_video_buffer2() to return frames with the old width/height. I think this bug was avoided in practice because the only filters to actually support changing the resolution at runtime already always explicitly overrode the width/height of allocated output buffers by the link properties. Signed-off-by: Niklas Haas --- libavfilter/framepool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c index 61451cdb4e..88cee7f676 100644 --- a/libavfilter/framepool.c +++ b/libavfilter/framepool.c @@ -305,6 +305,8 @@ int ff_frame_pool_video_reinit(FFFramePool **pool, cur->align == align) { av_assert1(cur->type == AVMEDIA_TYPE_VIDEO); + cur->width = width; + cur->height = height; return 0; }