From dcf614279426ad1b56949c7c06754e0fcea44e56 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 9 Mar 2025 23:00:04 +0100 Subject: [PATCH] avcodec/ffv1enc: add space for the remap table to max_size Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/ffv1enc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index abdb284302..e89e4c9e2c 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -1249,6 +1249,8 @@ size_t ff_ffv1_encode_buffer_size(AVCodecContext *avctx) maxsize += f->slice_count * 800; //for slice header if (f->version > 3) { maxsize *= f->bits_per_raw_sample + 1; + if (f->flt) //remap table + maxsize += f->slice_count * 70000 * (1 + 2*f->chroma_planes + f->transparency); } else { maxsize += f->slice_count * 2 * (avctx->width + avctx->height); //for bug with slices that code some pixels more than once maxsize *= 8*(2*f->bits_per_raw_sample + 5);