]> git.sesse.net Git - ffmpeg/commitdiff
wavpack: fix out of array access
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 12 Nov 2012 13:42:45 +0000 (14:42 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 12 Nov 2012 13:43:05 +0000 (14:43 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wavpack.c

index 69637fee51a47304975644dbaec0c890cdcf597a..2935abfa8bb7e6fda503de0886c1c1ddf1fa2de1 100644 (file)
@@ -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) {