avfilter/framepool: add a few padding lines by aligning height

Fixes segfaults when handling files with odd chroma subsampled dimensions in
some scenarios like using the hstack filter.

./ffmpeg -lavfi testsrc=s=255x31,format=yuv420p -vframes 1 -y in.jpg && \
./ffmpeg -i in.jpg -i in.jpg -i in.jpg -i in.jpg -filter_complex "xstack=inputs=4:grid=2x2" -y out.png

Fixes issue #21739.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2026-02-12 12:20:04 -03:00
parent 7c877b2e80
commit 14097ee1cd

View File

@@ -92,7 +92,7 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size),
linesizes[i] = pool->linesize[i];
if (av_image_fill_plane_sizes(sizes, pool->format,
pool->height,
FFALIGN(pool->height, align),
linesizes) < 0) {
goto fail;
}