]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Check classbook value.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 23 Sep 2009 12:02:31 +0000 (12:02 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 23 Sep 2009 12:02:31 +0000 (12:02 +0000)
11_vorbis_residue_book_index.patch by chrome.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19989 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/vorbis_dec.c

index ce5a139ef48fb259c655334e2c7987c3089a8aa8..2d5e610da437162b667a77308b6e4de73ee2139d 100644 (file)
@@ -630,6 +630,10 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc){
         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);