[FFmpeg-cvslog] wavpack: fix out of array access

Michael Niedermayer git at videolan.org
Mon Nov 12 15:12:06 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 12 14:42:45 2012 +0100| [be818df547c3b0ae4fadb50fd210139a8636706a] | committer: Michael Niedermayer

wavpack: fix out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be818df547c3b0ae4fadb50fd210139a8636706a
---

 libavcodec/wavpack.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 69637fe..2935abf 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) {



More information about the ffmpeg-cvslog mailing list