Fix out of bound reads in the QDM2 decoder.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 30 Sep 2011 22:45:04 +0000 (00:45 +0200)
committerReinhard Tartler <siretart@tauware.de>
Sun, 4 Dec 2011 07:55:55 +0000 (08:55 +0100)
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>
libavcodec/qdm2.c

index eeb7fa3..d1619ef 100644 (file)
@@ -1354,6 +1354,8 @@ static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *
             return;
 
         local_int_14 = (offset >> local_int_8);
+        if (local_int_14 >= FF_ARRAY_ELEMS(fft_level_index_table))
+            return;
 
         if (q->nb_channels > 1) {
             channel = get_bits1(gb);