diff options
author | Google Chrome <> | 2009-09-23 12:24:21 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-09-23 12:24:21 +0000 |
commit | cdf1512ebac8b95afad3ec4352550f0f0240ce26 (patch) | |
tree | 4869edc771a7a3246fea82704039c654cddf766c /libavcodec | |
parent | 993092dcd3fb7ec84fdd1cd3b28a3973740b22bf (diff) | |
download | ffmpeg-cdf1512ebac8b95afad3ec4352550f0f0240ce26.tar.gz |
Check res_setup->books.
15_more_residue_book_indexes.patch by chrome.
Originally committed as revision 19992 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vorbis_dec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c index 3daba8f340..ca43e99d9b 100644 --- a/libavcodec/vorbis_dec.c +++ b/libavcodec/vorbis_dec.c @@ -663,7 +663,12 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc){ for(j=0;j<res_setup->classifications;++j) { for(k=0;k<8;++k) { if (cascade[j]&(1<<k)) { - res_setup->books[j][k]=get_bits(gb, 8); + int bits=get_bits(gb, 8); + if (bits>=vc->codebook_count) { + av_log(vc->avccontext, AV_LOG_ERROR, "book value %d out of range. \n", bits); + return 1; + } + res_setup->books[j][k]=bits; AV_DEBUG(" %d class casscade depth %d book: %d \n", j, k, res_setup->books[j][k]); |