aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2025-03-09 23:00:04 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2025-03-14 02:03:59 +0100
commitdcf614279426ad1b56949c7c06754e0fcea44e56 (patch)
treed718bdf647680273020baed112a08f0a45b5e1e8
parenta90ff8128772a03dd61dce7bcfc5d8416c9a6d8a (diff)
downloadffmpeg-dcf614279426ad1b56949c7c06754e0fcea44e56.tar.gz
avcodec/ffv1enc: add space for the remap table to max_size
Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffv1enc.c2
1 files changed, 2 insertions, 0 deletions
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);