Commit 99f95f39 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/vorbisdec: Check vlc for floor0 dec vector offset

Fixes: out of array access
Fixes: 15649/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VORBIS_fuzzer-5729191309344768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 308771a7
...@@ -1128,8 +1128,10 @@ static int vorbis_floor0_decode(vorbis_context *vc, ...@@ -1128,8 +1128,10 @@ static int vorbis_floor0_decode(vorbis_context *vc,
ff_dlog(NULL, "floor0 dec: maximum depth: %d\n", codebook.maxdepth); ff_dlog(NULL, "floor0 dec: maximum depth: %d\n", codebook.maxdepth);
/* read temp vector */ /* read temp vector */
vec_off = get_vlc2(&vc->gb, codebook.vlc.table, vec_off = get_vlc2(&vc->gb, codebook.vlc.table,
codebook.nb_bits, codebook.maxdepth) codebook.nb_bits, codebook.maxdepth);
* codebook.dimensions; if (vec_off < 0)
return AVERROR_INVALIDDATA;
vec_off *= codebook.dimensions;
ff_dlog(NULL, "floor0 dec: vector offset: %d\n", vec_off); ff_dlog(NULL, "floor0 dec: vector offset: %d\n", vec_off);
/* copy each vector component and add last to it */ /* copy each vector component and add last to it */
for (idx = 0; idx < codebook.dimensions; ++idx) for (idx = 0; idx < codebook.dimensions; ++idx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment