atrac3: set the getbits context the right buffer_end
authorLuca Barbato <lu_zero@gentoo.org>
Tue, 9 Jul 2013 02:20:23 +0000 (04:20 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 13 Sep 2013 13:44:49 +0000 (15:44 +0200)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 22e76ec635bafdd1d1ec35581a7ac09e69e3c43e)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavcodec/atrac3.c

libavcodec/atrac3.c

index e0702a9..cc0cc7c 100644 (file)
@@ -773,7 +773,7 @@ static int decodeFrame(ATRAC3Context *q, const uint8_t* databuf,
 
 
         /* set the bitstream reader at the start of the second Sound Unit*/
-        init_get_bits(&q->gb,ptr1,q->bits_per_frame);
+        init_get_bits(&q->gb, ptr1, (q->bytes_per_frame - i) * 8);
 
         /* Fill the Weighting coeffs delay buffer */
         memmove(q->weighting_delay,&(q->weighting_delay[2]),4*sizeof(int));