From: Andre Noll Date: Sun, 11 Jun 2017 13:59:17 +0000 (+0200) Subject: wma: Remove pointless/incorrect sanity checks. X-Git-Tag: v0.6.1~44^2~5 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=9943be4e9a56cedf1d0ec6317ca09da3ccc3949e;p=paraslash.git wma: Remove pointless/incorrect sanity checks. In wma_decode_superframe() we check the size of the input buffer twice. Both checks are redundant because the input queue size of the wmadec filter node already makes sure we never pass a smaller value. The second check is in fact wrong, because pwd->ahi.packet_size - WMA_FRAME_SKIP would be the correct limit to check. --- diff --git a/wmadec_filter.c b/wmadec_filter.c index 6a5df98e..a76f77df 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -1046,16 +1046,7 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, int ret; int16_t *samples; - if (buf_size == 0) { - pwd->last_superframe_len = 0; - *data_size = 0; - return 0; - } - if (buf_size < pwd->ahi.block_align) { - *data_size = 0; - return 0; - } - buf_size = pwd->ahi.block_align; + buf_size = pwd->ahi.packet_size - WMA_FRAME_SKIP; samples = data; init_get_bits(&pwd->gb, buf, buf_size); if (pwd->ahi.use_bit_reservoir) {