changeset 10243:add8ca5921ab libavcodec

Check classbook value. 11_vorbis_residue_book_index.patch by chrome.
author michael
date Wed, 23 Sep 2009 12:02:31 +0000
parents 359554637332
children ae97152542d1
files vorbis_dec.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vorbis_dec.c	Wed Sep 23 11:44:30 2009 +0000
+++ b/vorbis_dec.c	Wed Sep 23 12:02:31 2009 +0000
@@ -630,6 +630,10 @@
         res_setup->partition_size=get_bits(gb, 24)+1;
         res_setup->classifications=get_bits(gb, 6)+1;
         res_setup->classbook=get_bits(gb, 8);
+        if (res_setup->classbook>=vc->codebook_count) {
+            av_log(vc->avccontext, AV_LOG_ERROR, "classbook value %d out of range. \n", res_setup->classbook);
+            return 1;
+        }
 
         AV_DEBUG("    begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size,
           res_setup->classifications, res_setup->classbook);