1
diff -rpu unpatched_ffmpeg-mt/libavcodec/aac.c ffmpeg-mt/libavcodec/aac.c
2
--- unpatched_ffmpeg-mt/libavcodec/aac.c 2010-03-11 17:46:29 -0800
3
+++ ffmpeg-mt/libavcodec/aac.c 2010-03-11 19:13:44 -0800
4
@@ -449,6 +449,7 @@ static int decode_audio_specific_config(
1
diff -rpu -N orig/libavcodec/aacdec.c ffmpeg-mt/libavcodec/aacdec.c
2
--- orig/libavcodec/aacdec.c 2010-07-27 13:08:19.390713400 -0700
3
+++ ffmpeg-mt/libavcodec/aacdec.c 2010-07-27 13:08:22.393013600 -0700
4
@@ -466,6 +466,7 @@ static int decode_audio_specific_config(
7
7
init_get_bits(&gb, data, data_size * 8);
8
8
+ gb.buffer_enforcing = 1;
10
10
if ((i = ff_mpeg4audio_get_config(&ac->m4ac, data, data_size)) < 0)
12
@@ -1965,6 +1966,7 @@ static int aac_decode_frame(AVCodecConte
13
int samples = 1024, multiplier;
12
@@ -1946,6 +1947,7 @@ static int aac_decode_frame(AVCodecConte
15
15
init_get_bits(&gb, buf, buf_size * 8);
16
16
+ gb.buffer_enforcing = 1;
18
18
if (show_bits(&gb, 12) == 0xfff) {
19
19
if (parse_adts_frame_header(ac, &gb) < 0) {
20
@@ -1979,6 +1981,12 @@ static int aac_decode_frame(AVCodecConte
20
@@ -1961,6 +1963,12 @@ static int aac_decode_frame(AVCodecConte
21
memset(ac->tags_seen_this_frame, 0, sizeof(ac->tags_seen_this_frame));
23
23
while ((elem_type = get_bits(&gb, 3)) != TYPE_END) {
24
24
+#ifdef ALT_BITSTREAM_READER
25
25
+ if (gb.buffer_exhausted) {
26
+ av_log(ac->avccontext, AV_LOG_ERROR, "out of bounds read: index, size: %d, %d\n", gb.index, gb.size_in_bits);
26
+ av_log(ac->avctx, AV_LOG_ERROR, "out of bounds read: index, size: %d, %d\n", gb.index, gb.size_in_bits);
30
30
elem_id = get_bits(&gb, 4);
32
if (elem_type < TYPE_DSE && !(che=get_che(ac, elem_type, elem_id))) {
32
if (elem_type < TYPE_DSE) {