aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-09-19 21:17:32 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:37:21 +0200
commitc58f0345b89d2eaa9e692717a2c71ecd79237105 (patch)
tree1998dffed3b15e5cb1206f5479e388ed9d311897 /libavcodec
parent4b6bcdd9973bb97e3b57afc742a596d5f46f40de (diff)
downloadffmpeg-c58f0345b89d2eaa9e692717a2c71ecd79237105.tar.gz
avcodec/ansi: Check initial dimensions
Fixes: Timeout (minutes to less than 1sec) Fixes: 25682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ANSI_fuzzer-6320712032452608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 949f0a6be974e4083f8e130c2d6870ef26f0eece) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ansi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index c42d6d3dba..e4106dcf72 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -474,6 +474,11 @@ static av_cold int decode_close(AVCodecContext *avctx)
return 0;
}
+static const AVCodecDefault ansi_defaults[] = {
+ { "max_pixels", "640*480" },
+ { NULL },
+};
+
AVCodec ff_ansi_decoder = {
.name = "ansi",
.long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"),
@@ -485,4 +490,5 @@ AVCodec ff_ansi_decoder = {
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
+ .defaults = ansi_defaults,
};