From: Michael Niedermayer Date: Mon, 12 Nov 2012 13:42:45 +0000 (+0100) Subject: wavpack: fix out of array access X-Git-Tag: n1.1~1438 X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=be818df547c3b0ae4fadb50fd210139a8636706a wavpack: fix out of array access Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 69637fee51..2935abfa8b 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1208,11 +1208,12 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data, } /* get output buffer */ - s->frame.nb_samples = s->samples; + s->frame.nb_samples = s->samples + 1; if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } + s->frame.nb_samples = s->samples; while (buf_size > 0) { if (!s->multichannel) {