[FFmpeg-cvslog] avcodec/vp3: Check input amount in theora_decode_header()

Michael Niedermayer git at videolan.org
Sun Jan 31 15:45:31 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Jan 30 00:46:26 2021 +0100| [869fe41d1088c4badcd98ee1ca2490451a07b173] | committer: Michael Niedermayer

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 at xvid.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/vp3.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 2a1da6b062..57c6eb1ff9 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2875,6 +2875,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(gb, 24);
     av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);



More information about the ffmpeg-cvslog mailing list