~ubuntu-branches/ubuntu/maverick/chromium-codecs-ffmpeg/maverick

« back to all changes in this revision

Viewing changes to patches/ugly/10_aac_oob_read.patch

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2010-08-15 04:00:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100815040002-2lrzpxbuk1xuqp7u
Tags: 0.6+svn20100811r55740+56137-0ubuntu1
* New upstream snapshot (LP: #628924)
* Drop the sse2 patch, it has been applied upstream, and set disable_sse2
  - drop debian/patches/*
  - update debian/rules
* Unpack the sources during pre-build so quilt has access to all source files
  and set QUILT_PATCHES (for hardy)
  - update debian/rules
* Add libvpx-dev to Build-Depends and set the use_system_vpx gyp knob
  - update debian/control
  - update debian/rules
* Re-do the get-orig-source rule with 2 repos instead of 3 following
  the upstream reorganization and follow the revision requested by
  Chromium for now on
  - update debian/rules
* FTBFS when an upstream patch fails to apply, as it could lead to weird
  situations
  - update debian/rules
* Bump build-deps for gyp to >= 0.1~svn837
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
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(
5
5
     int i;
6
 
 
 
6
 
7
7
     init_get_bits(&gb, data, data_size * 8);
8
8
+    gb.buffer_enforcing = 1;
9
 
 
 
9
 
10
10
     if ((i = ff_mpeg4audio_get_config(&ac->m4ac, data, data_size)) < 0)
11
11
         return -1;
12
 
@@ -1965,6 +1966,7 @@ static int aac_decode_frame(AVCodecConte
13
 
     int samples = 1024, multiplier;
14
 
 
 
12
@@ -1946,6 +1947,7 @@ static int aac_decode_frame(AVCodecConte
 
13
     int buf_offset;
 
14
 
15
15
     init_get_bits(&gb, buf, buf_size * 8);
16
16
+    gb.buffer_enforcing = 1;
17
 
 
 
17
 
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
21
 
 
 
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));
22
22
     // parse
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);
27
27
+            return -1;
28
28
+        }
29
29
+#endif
30
30
         elem_id = get_bits(&gb, 4);
31
 
 
32
 
         if (elem_type < TYPE_DSE && !(che=get_che(ac, elem_type, elem_id))) {
33
 
 
 
31
 
 
32
         if (elem_type < TYPE_DSE) {