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 <git@haasn.dev>
This commit is contained in:
Niklas Haas
2026-03-24 18:10:17 +01:00
parent ad7956d5bb
commit a0510f7f72

View File

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