summaryrefslogtreecommitdiff
path: root/libavcodec/atrac3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-26 04:27:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-26 04:27:53 +0100
commitc8f25cafd2f23662bcb1e62965c0c42d6989688a (patch)
tree5adc8737f6f1e1305c78752bdb56a7904db37a26 /libavcodec/atrac3.c
parent66daebc9d50d8095bb067138168e57b6a1880a19 (diff)
atrac3: fix buffer size for get_bits.
Fixes out of array reads Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/atrac3.c')
-rw-r--r--libavcodec/atrac3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 84c5c11fca..1e54784a8d 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -740,7 +740,7 @@ static int decode_frame(AVCodecContext *avctx, const uint8_t *databuf,
/* set the bitstream reader at the start of the second Sound Unit*/
- init_get_bits(&q->gb, ptr1, avctx->block_align * 8);
+ init_get_bits8(&q->gb, ptr1, q->decoded_bytes_buffer + avctx->block_align - ptr1);
/* Fill the Weighting coeffs delay buffer */
memmove(q->weighting_delay, &q->weighting_delay[2],