diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2014-08-22 09:31:44 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2014-08-22 18:43:30 +0000 |
commit | a59f85d1064d5eeea9c0d6a4db8d0f4f76605d93 (patch) | |
tree | 42f71b68d9d96ceea7e79cfb759b1fc3402f7407 /libavcodec/wavpack.c | |
parent | 350dd8534575e89a8ed5f2bdafc24651a82338e5 (diff) | |
download | ffmpeg-a59f85d1064d5eeea9c0d6a4db8d0f4f76605d93.tar.gz |
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.
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r-- | libavcodec/wavpack.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 9f72ebef2b..1ad3901600 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -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; |