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

« back to all changes in this revision

Viewing changes to patches/ugly/14_enforce_theora_oob.patch

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2010-03-27 13:03:29 UTC
  • Revision ID: james.westby@ubuntu.com-20100327130329-ic9q2nf2kuj3lgyr
Tags: upstream-0.5+svn20100326r42726+42573+42890
ImportĀ upstreamĀ versionĀ 0.5+svn20100326r42726+42573+42890

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -rpu unpatched_ffmpeg-mt/libavcodec/vp3.c ffmpeg-mt/libavcodec/vp3.c
 
2
--- unpatched_ffmpeg-mt/libavcodec/vp3.c        2010-03-11 17:46:30 -0800
 
3
+++ ffmpeg-mt/libavcodec/vp3.c  2010-03-11 19:13:21 -0800
 
4
@@ -922,6 +922,11 @@ static int unpack_vlcs(Vp3DecodeContext
 
5
     int num_coeffs = s->num_coded_frags[plane][coeff_index];
 
6
     int16_t *dct_tokens = s->dct_tokens[plane][coeff_index];
 
7
 
 
8
+#ifdef ALT_BITSTREAM_READER
 
9
+    if (gb->buffer_exhausted && gb->index > gb->size_in_bits)
 
10
+        return 0;
 
11
+#endif
 
12
+
 
13
     /* local references to structure members to avoid repeated deferences */
 
14
     int *coded_fragment_list = s->coded_fragment_list[plane];
 
15
     Vp3Fragment *all_fragments = s->all_fragments;
 
16
@@ -1099,6 +1104,11 @@ static int unpack_dct_coeffs(Vp3DecodeCo
 
17
                 2, residual_eob_run);
 
18
     }
 
19
 
 
20
+#ifdef ALT_BITSTREAM_READER
 
21
+    if (gb->buffer_exhausted && gb->index > gb->size_in_bits)
 
22
+        return 1;
 
23
+#endif
 
24
+
 
25
     return 0;
 
26
 }
 
27
 
 
28
@@ -1882,6 +1892,7 @@ static int vp3_decode_frame(AVCodecConte
 
29
     int i;
 
30
 
 
31
     init_get_bits(&gb, buf, buf_size * 8);
 
32
+    gb.buffer_enforcing = 1;
 
33
 
 
34
     if (s->theora && get_bits1(&gb))
 
35
     {
 
36
@@ -2305,6 +2316,7 @@ static av_cold int theora_decode_init(AV
 
37
 
 
38
   for(i=0;i<3;i++) {
 
39
     init_get_bits(&gb, header_start[i], header_len[i] * 8);
 
40
+    gb.buffer_enforcing = 1;
 
41
 
 
42
     ptype = get_bits(&gb, 8);
 
43
 
 
44