wavpack: check number of channels

This means container and codec disagree. The codec is supposed to
know better so this could be an error instead.
This commit is contained in:
Christophe Gisquet 2014-08-22 09:31:44 +00:00 committed by Paul B Mahol
parent 350dd85345
commit a59f85d106
1 changed files with 4 additions and 1 deletions

View File

@ -906,7 +906,10 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
chmask = bytestream2_get_le32(&gb);
break;
case 5:
bytestream2_skip(&gb, 1);
size = bytestream2_get_byte(&gb);
if (avctx->channels != size)
av_log(avctx, AV_LOG_WARNING, "%i channels signalled"
" instead of %i.\n", size, avctx->channels);
chan |= (bytestream2_get_byte(&gb) & 0xF) << 8;
chmask = bytestream2_get_le16(&gb);
break;