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)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 1 Oct 2011 19:03:40 +0000 (21:03 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 491eaf35ae1f9b619441314bec33766e31580184)

libavcodec/qdm2.c

index 6eb8364..a6192e9 100644 (file)
@@ -1353,6 +1353,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);