summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-08-22 09:31:44 +0000
committerPaul B Mahol <onemda@gmail.com>2014-08-22 18:43:30 +0000
commita59f85d1064d5eeea9c0d6a4db8d0f4f76605d93 (patch)
tree42f71b68d9d96ceea7e79cfb759b1fc3402f7407
parent350dd8534575e89a8ed5f2bdafc24651a82338e5 (diff)
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.
-rw-r--r--libavcodec/wavpack.c5
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;