aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-30 00:46:26 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:20 +0200
commit05efd2ec5c0ae8c6d41da2f8404fb3f7b9203c31 (patch)
tree3803fea1c86db7a3d6e8cb21f9fa93a7a4ad0892
parente59cb0f33a83b7a65f92d508c41108d6ca4432c5 (diff)
downloadffmpeg-05efd2ec5c0ae8c6d41da2f8404fb3f7b9203c31.tar.gz
avcodec/vp3: Check input amount in theora_decode_header()
Fixes: Timeout Fixes: 29226/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-6195092572471296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 869fe41d1088c4badcd98ee1ca2490451a07b173) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vp3.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index f9bd4270e8..0b8e10156e 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2272,6 +2272,9 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
int ret;
AVRational fps, aspect;
+ if (get_bits_left(gb) < 206)
+ return AVERROR_INVALIDDATA;
+
s->theora_header = 0;
s->theora = get_bits_long(gb, 24);
av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);