From 89806691b1c39181c63d95e0fddc30f11e2a7b04 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 27 May 2013 19:13:14 +0200 Subject: wavpack: check that all the channels were coded. --- libavcodec/wavpack.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/wavpack.c') diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 7a14519bf9..0847238595 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1212,6 +1212,11 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data, buf_size -= frame_size; } + if (s->ch_offset != avctx->channels) { + av_log(avctx, AV_LOG_ERROR, "Not enough channels coded in a packet.\n"); + return AVERROR_INVALIDDATA; + } + *got_frame_ptr = 1; return avpkt->size; -- cgit v1.2.3