| OLD | NEW |
| 1 diff -rpu -N orig/libavcodec/vp3.c ffmpeg-mt/libavcodec/vp3.c | 1 diff -wurp -N orig/libavcodec/vp3.c ffmpeg-mt/libavcodec/vp3.c |
| 2 --- orig/libavcodec/vp3.c» 2010-10-11 16:55:01 -0700 | 2 --- orig/libavcodec/vp3.c» 2010-11-04 08:07:33 -0700 |
| 3 +++ ffmpeg-mt/libavcodec/vp3.c» 2010-10-11 16:55:02 -0700 | 3 +++ ffmpeg-mt/libavcodec/vp3.c» 2010-11-04 08:07:37 -0700 |
| 4 @@ -869,6 +869,11 @@ static int unpack_vlcs(Vp3DecodeContext | 4 @@ -869,6 +869,11 @@ static int unpack_vlcs(Vp3DecodeContext |
| 5 int num_coeffs = s->num_coded_frags[plane][coeff_index]; | 5 int num_coeffs = s->num_coded_frags[plane][coeff_index]; |
| 6 int16_t *dct_tokens = s->dct_tokens[plane][coeff_index]; | 6 int16_t *dct_tokens = s->dct_tokens[plane][coeff_index]; |
| 7 | 7 |
| 8 +#ifdef ALT_BITSTREAM_READER | 8 +#ifdef ALT_BITSTREAM_READER |
| 9 + if (gb->buffer_exhausted && gb->index > gb->size_in_bits) | 9 + if (gb->buffer_exhausted && gb->index > gb->size_in_bits) |
| 10 + return 0; | 10 + return 0; |
| 11 +#endif | 11 +#endif |
| 12 + | 12 + |
| 13 /* local references to structure members to avoid repeated deferences */ | 13 /* local references to structure members to avoid repeated deferences */ |
| 14 int *coded_fragment_list = s->coded_fragment_list[plane]; | 14 int *coded_fragment_list = s->coded_fragment_list[plane]; |
| 15 Vp3Fragment *all_fragments = s->all_fragments; | 15 Vp3Fragment *all_fragments = s->all_fragments; |
| 16 @@ -1046,6 +1051,11 @@ static int unpack_dct_coeffs(Vp3DecodeCo | 16 @@ -1046,6 +1051,11 @@ static int unpack_dct_coeffs(Vp3DecodeCo |
| 17 2, residual_eob_run); | 17 2, residual_eob_run); |
| 18 } | 18 } |
| 19 | 19 |
| 20 +#ifdef ALT_BITSTREAM_READER | 20 +#ifdef ALT_BITSTREAM_READER |
| 21 + if (gb->buffer_exhausted && gb->index > gb->size_in_bits) | 21 + if (gb->buffer_exhausted && gb->index > gb->size_in_bits) |
| 22 + return 1; | 22 + return 1; |
| 23 +#endif | 23 +#endif |
| 24 + | 24 + |
| 25 return 0; | 25 return 0; |
| 26 } | 26 } |
| 27 | 27 |
| 28 @@ -1843,6 +1853,7 @@ static int vp3_decode_frame(AVCodecConte | 28 @@ -1841,6 +1851,7 @@ static int vp3_decode_frame(AVCodecConte |
| 29 int i; | 29 int i; |
| 30 | 30 |
| 31 init_get_bits(&gb, buf, buf_size * 8); | 31 init_get_bits(&gb, buf, buf_size * 8); |
| 32 + gb.buffer_enforcing = 1; | 32 + gb.buffer_enforcing = 1; |
| 33 | 33 |
| 34 if (s->theora && get_bits1(&gb)) | 34 if (s->theora && get_bits1(&gb)) |
| 35 { | 35 { |
| 36 @@ -2292,6 +2303,7 @@ static av_cold int theora_decode_init(AV | 36 @@ -2286,6 +2297,7 @@ static av_cold int theora_decode_init(AV |
| 37 | 37 |
| 38 for(i=0;i<3;i++) { | 38 for(i=0;i<3;i++) { |
| 39 init_get_bits(&gb, header_start[i], header_len[i] * 8); | 39 init_get_bits(&gb, header_start[i], header_len[i] * 8); |
| 40 + gb.buffer_enforcing = 1; | 40 + gb.buffer_enforcing = 1; |
| 41 | 41 |
| 42 ptype = get_bits(&gb, 8); | 42 ptype = get_bits(&gb, 8); |
| 43 | 43 |
| OLD | NEW |