summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-12-17 16:19:24 +0000
committerMans Rullgard <mans@mansr.com>2011-12-17 17:51:22 +0000
commitac08f798bbfe6b3a631964a26da961e692b1c9af (patch)
tree71e51793f5abb03bfbe0f1f00e3735b525284c39 /libavcodec/mpegaudiodec.c
parent583d3b7f97be065165ed742e108423704279516b (diff)
mp3dec: hack: fix decoding with safe bitstream reader
The buffer splicing relies on the bitstream reader over-reading the end of the buffer as declared in init_get_bits(), although more data is actually present. Manually moving the bitstream boundary after init_get_bits() allows this to work as expected. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r--libavcodec/mpegaudiodec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index eeef470a57..0c8f9c787b 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1548,6 +1548,9 @@ static int mp_decode_layer3(MPADecodeContext *s)
memcpy(s->last_buf + s->last_buf_size, ptr, EXTRABYTES);
s->in_gb = s->gb;
init_get_bits(&s->gb, s->last_buf, s->last_buf_size*8);
+#if CONFIG_SAFE_BITSTREAM_READER
+ s->gb.size_in_bits_plus8 += EXTRABYTES * 8;
+#endif
skip_bits_long(&s->gb, 8*(s->last_buf_size - main_data_begin));
}