aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Martinez <jerome@mediaarea.net>2025-04-09 00:04:55 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2025-04-16 13:09:04 +0200
commit0c28059b812f4e21e68de15bfa5fa984743f69c1 (patch)
treeeca08674c6d95477e15bba9b5647ad592c6c795d
parentc818c67991a619d206f109ad11328553edeb0d39 (diff)
downloadffmpeg-0c28059b812f4e21e68de15bfa5fa984743f69c1.tar.gz
avcodec/ffv1enc: avoid repeating the same warning forever
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffv1.h1
-rw-r--r--libavcodec/ffv1enc.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h
index 9472f9c958..ee0a1a7858 100644
--- a/libavcodec/ffv1.h
+++ b/libavcodec/ffv1.h
@@ -151,6 +151,7 @@ typedef struct FFV1Context {
int flt;
int remap_mode;
int remap_optimizer;
+ int maxsize_warned;
int use32bit;
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 807850a432..ea7e6e8bd7 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -1749,7 +1749,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
maxsize = ff_ffv1_encode_buffer_size(avctx);
if (maxsize > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 32) {
- av_log(avctx, AV_LOG_WARNING, "Cannot allocate worst case packet size, the encoding could fail\n");
+ FFV1Context *f = avctx->priv_data;
+ if (!f->maxsize_warned) {
+ av_log(avctx, AV_LOG_WARNING, "Cannot allocate worst case packet size, the encoding could fail\n");
+ f->maxsize_warned++;
+ }
maxsize = INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 32;
}