[FFmpeg-devel] [PATCH 3/4] wavpack: check number of channels
Christophe Gisquet
christophe.gisquet at gmail.com
Fri Aug 22 11:31:44 CEST 2014
This means container and codec disagree. The codec is supposed to
know better so this could be an error instead.
---
libavcodec/wavpack.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 9f72ebe..1ad3901 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;
--
1.9.2.msysgit.0
More information about the ffmpeg-devel
mailing list