changeset 10246:d82fb1889446 libavcodec

Check res_setup->books. 15_more_residue_book_indexes.patch by chrome.
author michael
date Wed, 23 Sep 2009 12:24:21 +0000
parents 8da436e9793d
children d405b8e7461a
files vorbis_dec.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/vorbis_dec.c	Wed Sep 23 12:17:54 2009 +0000
+++ b/vorbis_dec.c	Wed Sep 23 12:24:21 2009 +0000
@@ -663,7 +663,12 @@
         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]);