Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-11-30 21:46:17 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-06 21:38:05 +0300
commita452eddfadd0b98e05a97d5572b3c6b71aa908d2 (patch)
tree7fbce2921f184f63b562cbd49450fc2fe00434bc /libavcodec
parent867b978dc90a8bf3dce2a76620f28d8dc7cb139a (diff)
avcodec/vp3: Check version in all cases when VP4 code is not built
Fixes: out of array read Fixes: 40284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-4599568176644096 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 96caa01f130526cb420d0706a40fb63695153128) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp3.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 0fc64581c6..49d4911fb3 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2741,7 +2741,14 @@ static int vp3_decode_frame(AVCodecContext *avctx,
skip_bits(&gb, 4); /* width code */
skip_bits(&gb, 4); /* height code */
if (s->version) {
- s->version = get_bits(&gb, 5);
+ int version = get_bits(&gb, 5);
+#if !CONFIG_VP4_DECODER
+ if (version >= 2) {
+ av_log(avctx, AV_LOG_ERROR, "This build does not support decoding VP4.\n");
+ return AVERROR_DECODER_NOT_FOUND;
+ }
+#endif
+ s->version = version;
if (avctx->frame_number == 0)
av_log(s->avctx, AV_LOG_DEBUG,
"VP version: %d\n", s->version);