diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-22 00:41:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:42 +0100 |
commit | 14df7f8cbcc04b3b63812e1d367c82049cf8815f (patch) | |
tree | 22e5c0dc7b7adb023b1bdcbb4cdcf7184e73afae | |
parent | 46a1b4e8acccae5bbfb5aaac8ffdaf2ddf64d98e (diff) | |
download | ffmpeg-14df7f8cbcc04b3b63812e1d367c82049cf8815f.tar.gz |
avcodec/vp3: Check that theora is theora
Theora is forced to be non zero if it is zero and a sample
is asked for, as suggested by reimar
Fixes: Timeout (2min -> 600ms)
Fixes: 15366/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-5737849938247680
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 b4bf7226aff28e9ca379c5a3dedf745a2d316739)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vp3.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 9df2fda49d..df6782e3ab 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2315,6 +2315,10 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) s->theora_header = 0; s->theora = get_bits_long(gb, 24); av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora); + if (!s->theora) { + s->theora = 1; + avpriv_request_sample(s->avctx, "theora 0"); + } /* 3.2.0 aka alpha3 has the same frame orientation as original vp3 * but previous versions have the image flipped relative to vp3 */ |