[FFmpeg-devel] [PATCH] avfilter/framepool: fix alignment requirements for audio and video filters
Anton Khirnov
anton at khirnov.net
Mon Feb 21 13:07:52 EET 2022
Quoting Paul B Mahol (2022-02-20 19:07:47)
> diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c
> index aab408d355..aaf1642b4f 100644
> --- a/libavfilter/framepool.c
> +++ b/libavfilter/framepool.c
> @@ -76,15 +76,13 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size),
> }
>
> if (!pool->linesize[0]) {
> - for(i = 1; i <= align; i += i) {
> - ret = av_image_fill_linesizes(pool->linesize, pool->format,
> - FFALIGN(pool->width, i));
> - if (ret < 0) {
> - goto fail;
> - }
> - if (!(pool->linesize[0] & (pool->align - 1)))
> - break;
> + ret = av_image_fill_linesizes(pool->linesize, pool->format,
> + FFALIGN(pool->width, align));
> + if (ret < 0) {
> + goto fail;
> }
> + if ((pool->linesize[0] & (pool->align - 1)))
Check all of them, not just the first one.
Otherwise looks good.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list