diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 01:12:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 01:13:07 +0100 |
commit | d8a1eb11b72071ba88946191f8bc9701167d39a6 (patch) | |
tree | 347f268a11f56c76affd6ddd03c195b873ccca7c /libavcodec/wavpack.c | |
parent | 580021cfc45847d9d0fbbbfe4045c40cc56924bf (diff) | |
download | ffmpeg-streaming-d8a1eb11b72071ba88946191f8bc9701167d39a6.zip ffmpeg-streaming-d8a1eb11b72071ba88946191f8bc9701167d39a6.tar.gz |
wavpack: check the blocks sample count, fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r-- | libavcodec/wavpack.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index b36fa0a..bc038a9 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; } |