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],