Browse code

Fix out of bound reads in the QDM2 decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
(cherry picked from commit 5a19acb17ceb71657b0eec51dac651953520e5c8)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Laurent Aimar authored on 2011/10/01 07:45:04
Showing 1 changed files
... ...
@@ -1354,6 +1354,8 @@ static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *
1354 1354
             return;
1355 1355
 
1356 1356
         local_int_14 = (offset >> local_int_8);
1357
+        if (local_int_14 >= FF_ARRAY_ELEMS(fft_level_index_table))
1358
+            return;
1357 1359
 
1358 1360
         if (q->nb_channels > 1) {
1359 1361
             channel = get_bits1(gb);