aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-05-17 18:29:15 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-05-18 20:39:32 +0200
commited50673066956d6f2201a57c3254569f2ab08d9d (patch)
tree491e56c2e556f1a981d2215019108457e1ce8bc7
parent8c34558131d846d2b10389564caadaa206372fd4 (diff)
downloadffmpeg-ed50673066956d6f2201a57c3254569f2ab08d9d.tar.gz
wavpack: validate samples size parsed in wavpack_decode_block
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
-rw-r--r--libavcodec/wavpack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 38fc26b7ea..8d7c82b2fe 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -796,6 +796,9 @@ 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)
+ return AVERROR_INVALIDDATA;
+
if (!s->samples) {
*got_frame_ptr = 0;
return 0;