ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Sun 
Mar  9 23:00:04 2025 +0100| [dcf614279426ad1b56949c7c06754e0fcea44e56] | 
committer: Michael Niedermayer

avcodec/ffv1enc: add space for the remap table to max_size

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dcf614279426ad1b56949c7c06754e0fcea44e56
---

 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);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to