# HG changeset patch # User ramiro # Date 1238384812 0 # Node ID 37313693196ad214edc797551b56c9817b13b083 # Parent b00fc746bdf455c2dbd6957e505f3cc2f684a2f1 mlpdec: Simplify check for substream_parity_present. diff -r b00fc746bdf4 -r 37313693196a mlpdec.c --- 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);