aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-30 00:46:26 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-11 21:23:48 +0200
commitcd6449508401b5f44d3e5f4dbf72be883d984682 (patch)
treee31a7917644408ba37c42f2b4a7882cb7ed4d1f6
parent9b43c8d34ad561b9e906e24143b5cacf7019ba5d (diff)
downloadffmpeg-cd6449508401b5f44d3e5f4dbf72be883d984682.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 38cecf22a9..5ecbf9f383 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2273,6 +2273,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);