Commit a59f85d1 authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Paul B Mahol

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.
parent 350dd853
...@@ -906,7 +906,10 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, ...@@ -906,7 +906,10 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
chmask = bytestream2_get_le32(&gb); chmask = bytestream2_get_le32(&gb);
break; break;
case 5: 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; chan |= (bytestream2_get_byte(&gb) & 0xF) << 8;
chmask = bytestream2_get_le16(&gb); chmask = bytestream2_get_le16(&gb);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment