Mercurial > libavcodec.hg
changeset 9288:37313693196a libavcodec
mlpdec: Simplify check for substream_parity_present.
author | ramiro |
---|---|
date | Mon, 30 Mar 2009 03:46:52 +0000 |
parents | b00fc746bdf4 |
children | 238dd89b7ac3 |
files | mlpdec.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mlpdec.c Mon Mar 30 03:44:20 2009 +0000 +++ b/mlpdec.c Mon Mar 30 03:46:52 2009 +0000 @@ -1032,10 +1032,12 @@ if (substr == m->max_decoded_substream) av_log(m->avctx, AV_LOG_INFO, "End of stream indicated.\n"); } - if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 16 && - substream_parity_present[substr]) { + if (substream_parity_present[substr]) { uint8_t parity, checksum; + if (substream_data_len[substr] * 8 - get_bits_count(&gb) != 16) + goto substream_length_mismatch; + parity = ff_mlp_calculate_parity(buf, substream_data_len[substr] - 2); checksum = ff_mlp_checksum8 (buf, substream_data_len[substr] - 2);