diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-19 12:27:11 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-19 12:38:08 +0400 |
commit | 3e3514bce269f54b44773c72df3a12cbf4d8aa5b (patch) | |
tree | 3a771ce4abcce76614471b347aca8d39a91c138b /libavcodec/wavpack.c | |
parent | 2ad415cfa42069cad92803f2bc047b4311aa3c70 (diff) | |
parent | ed50673066956d6f2201a57c3254569f2ab08d9d (diff) |
Merge commit 'ed50673066956d6f2201a57c3254569f2ab08d9d'
* commit 'ed50673066956d6f2201a57c3254569f2ab08d9d':
wavpack: validate samples size parsed in wavpack_decode_block
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r-- | libavcodec/wavpack.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index c618537309..ca22620b9e 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -807,14 +807,15 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, if (!wc->mkv_mode) { s->samples = AV_RL32(buf); buf += 4; + if (s->samples != wc->samples) { + av_log(avctx, AV_LOG_ERROR, "mismatching sample count in block"); + return AVERROR_INVALIDDATA; + } + if (!s->samples) { *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; } |