diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2008-07-13 14:59:39 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2008-07-13 14:59:39 +0000 |
commit | eb2cd99c73df74cba8ce0173f9ee2b70313adaa6 (patch) | |
tree | 826b8177d7959a06e6315ce0383f2a71a9d96254 | |
parent | f27e1d645e609c01fbacfc2425818b56126df567 (diff) | |
download | ffmpeg-eb2cd99c73df74cba8ce0173f9ee2b70313adaa6.tar.gz |
mlpdec: Check for bits left before each read of End-of-Stream indicator and
Substream parity check independently. This allows decoding of streams that
have EOS but don't have Substream parity check.
Originally committed as revision 14206 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mlpdec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 14ad4786f2..f4d7313c4c 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -1119,7 +1119,7 @@ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size, && get_bits1(&gb) == 0); skip_bits(&gb, (-get_bits_count(&gb)) & 15); - if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 48 && + if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 32 && (show_bits_long(&gb, 32) == 0xd234d234 || show_bits_long(&gb, 20) == 0xd234e)) { skip_bits(&gb, 18); @@ -1133,7 +1133,8 @@ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size, } else skip_bits(&gb, 13); } - if (substream_parity_present[substr]) { + if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 16 && + substream_parity_present[substr]) { uint8_t parity, checksum; parity = calculate_parity(buf, substream_data_len[substr] - 2); |