mpc8: Check out of bound bands limit
authorLaurent Aimar <fenrir@videolan.org>
Sun, 25 Sep 2011 20:06:20 +0000 (20:06 +0000)
committerJanne Grunau <janne-libav@jannau.net>
Fri, 7 Oct 2011 15:15:45 +0000 (17:15 +0200)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavcodec/mpc8.c

index a126fc8..b386642 100644 (file)
@@ -266,6 +266,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx,
         maxband = c->last_max_band + get_vlc2(gb, band_vlc.table, MPC8_BANDS_BITS, 2);
         if(maxband > 32) maxband -= 33;
     }
+    if(maxband > c->maxbands)
+        return AVERROR_INVALIDDATA;
     c->last_max_band = maxband;
 
     /* read subband indexes */