Fix book_idx check.
authorGoogle Chrome <>
Tue, 9 Feb 2010 19:46:22 +0000 (19:46 +0000)
committerReinhard Tartler <siretart@tauware.de>
Tue, 9 Feb 2010 19:46:22 +0000 (19:46 +0000)
25_vorbis_floor0_index.patch by chrome.

backport r19984 by michael

Originally committed as revision 21724 to svn://svn.ffmpeg.org/ffmpeg/branches/0.5

libavcodec/vorbis_dec.c

index 305cead..29e7bdb 100644 (file)
@@ -558,12 +558,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) {
                 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;
                 }
             }