summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-12 14:42:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-12 14:43:05 +0100
commitbe818df547c3b0ae4fadb50fd210139a8636706a (patch)
tree880d3d3bdef6475bc184bf78f3e82386efd34745
parent0cbb31a26485d567f92fdf35838b1fd248003cd6 (diff)
wavpack: fix out of array access
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wavpack.c3
1 files changed, 2 insertions, 1 deletions
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) {