diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-14 00:27:09 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-31 19:51:57 +0100 |
commit | d7fbabaeb558e4fe48a9a6b358cfc2962418959a (patch) | |
tree | 1f75a746fbd48a6f245a3723fc63aeafa409d045 | |
parent | 9511cfe07f8d3b2df3276723fa794d1970ec5a10 (diff) | |
download | ffmpeg-d7fbabaeb558e4fe48a9a6b358cfc2962418959a.tar.gz |
avcodec/cbs_vp9: Check index_size
Fixes: out of array read
Fixes: 19300/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_METADATA_fuzzer-5653911730126848
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d6553e2e60a389296dd2f83a96f944ccfa5877a0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/cbs_vp9.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/cbs_vp9.c b/libavcodec/cbs_vp9.c index 5579d9b0af..80c9bac6e1 100644 --- a/libavcodec/cbs_vp9.c +++ b/libavcodec/cbs_vp9.c @@ -428,6 +428,9 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext *ctx, index_size = 2 + (((superframe_header & 0x18) >> 3) + 1) * ((superframe_header & 0x07) + 1); + if (index_size > frag->data_size) + return AVERROR_INVALIDDATA; + err = init_get_bits(&gbc, frag->data + frag->data_size - index_size, 8 * index_size); if (err < 0) |