From: Anton Khirnov Date: Mon, 27 May 2013 17:11:09 +0000 (+0200) Subject: wavpack: check that there aren't too many blocks per packet X-Git-Tag: android-x86-4.4-r1~364^2~927 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=eae1b8451a4d606dd457736ce7240ee12535fb36;p=android-x86%2Fexternal-ffmpeg.git wavpack: check that there aren't too many blocks per packet --- diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 9c766ca181..7a14519bf9 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1120,6 +1120,11 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, } } + if (wc->ch_offset + s->stereo >= avctx->channels) { + av_log(avctx, AV_LOG_WARNING, "Too many channels coded in a packet.\n"); + return (avctx->err_recognition & AV_EF_EXPLODE) ? AVERROR_INVALIDDATA : 0; + } + samples_l = frame->extended_data[wc->ch_offset]; if (s->stereo) samples_r = frame->extended_data[wc->ch_offset + 1];