avcodec/wavpack: simplify the code

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Limin Wang 2020-01-11 13:31:06 +08:00 committed by Michael Niedermayer
parent 1a7f4a122e
commit 8250bb49b1

View File

@ -1114,9 +1114,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
avctx->bits_per_raw_sample = ((frame_flags & 0x03) + 1) << 3; avctx->bits_per_raw_sample = ((frame_flags & 0x03) + 1) << 3;
} }
while (buf_size > 0) { while (buf_size > WV_HEADER_SIZE) {
if (buf_size <= WV_HEADER_SIZE)
break;
frame_size = AV_RL32(buf + 4) - 12; frame_size = AV_RL32(buf + 4) - 12;
buf += 20; buf += 20;
buf_size -= 20; buf_size -= 20;