changeset 10239:77246a6cffa0 libavcodec

Fix book_idx check. 25_vorbis_floor0_index.patch by chrome.
author michael
date Wed, 23 Sep 2009 10:45:14 +0000
parents b18b8aadb87a
children ccd7a1882c92
files vorbis_dec.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/vorbis_dec.c	Wed Sep 23 10:40:33 2009 +0000
+++ b/vorbis_dec.c	Wed Sep 23 10:45:14 2009 +0000
@@ -553,12 +553,11 @@
                 uint_fast8_t book_idx;
                 for (idx=0;idx<floor_setup->data.t0.num_books;++idx) {
                     book_idx=get_bits(gb, 8);
+                    if (book_idx>=vc->codebook_count)
+                        return 1;
                     floor_setup->data.t0.book_list[idx]=book_idx;
                     if (vc->codebooks[book_idx].dimensions > max_codebook_dim)
                         max_codebook_dim=vc->codebooks[book_idx].dimensions;
-
-                    if (floor_setup->data.t0.book_list[idx]>vc->codebook_count)
-                        return 1;
                 }
             }