Browse code

qdm2dec: check remaining input bits in the mainloop of qdm2_fft_decode_tones() This is neccessary but likely not sufficient to prevent out of array reads.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/11/19 01:56:24
Showing 1 changed files
... ...
@@ -1329,7 +1329,7 @@ static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *
1329 1329
     local_int_10 = 1 << (q->group_order - duration - 1);
1330 1330
     offset = 1;
1331 1331
 
1332
-    while (1) {
1332
+    while (get_bits_left(gb)>0) {
1333 1333
         if (q->superblocktype_2_3) {
1334 1334
             while ((n = qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2)) < 2) {
1335 1335
                 offset = 1;