From d8a1eb11b72071ba88946191f8bc9701167d39a6 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 13 Nov 2012 01:12:26 +0100 Subject: wavpack: check the blocks sample count, fix out of array accesses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/wavpack.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index b36fa0a28e..bc038a9534 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -806,6 +806,10 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, *got_frame_ptr = 0; return 0; } + if (s->samples > wc->samples) { + av_log(avctx, AV_LOG_ERROR, "too many samples in block"); + return -1; + } } else { s->samples = wc->samples; } -- cgit v1.2.3