[FFmpeg-cvslog] wavpack: check number of channels

Christophe Gisquet git at videolan.org
Fri Aug 22 20:47:11 CEST 2014


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Fri Aug 22 09:31:44 2014 +0000| [a59f85d1064d5eeea9c0d6a4db8d0f4f76605d93] | committer: 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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a59f85d1064d5eeea9c0d6a4db8d0f4f76605d93
---

 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;



More information about the ffmpeg-cvslog mailing list