diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-05-22 14:51:42 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-05-23 00:02:57 +0400 |
commit | fd06291239c1bb616bf303b5696cc432710b2530 (patch) | |
tree | d3e1ed0699d778aaa6e8b343d9384db3f28cb674 /libavcodec/wavpack.c | |
parent | 3f0b6d7a6248a33df37b98cfcb37a1acce263f62 (diff) |
wavpack: check packet size early
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r-- | libavcodec/wavpack.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index cfcd22d9f6..e6e9872491 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1203,6 +1203,9 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data, int frame_size, ret, frame_flags; int samplecount = 0; + if (avpkt->size < 12 + s->multichannel * 4) + return AVERROR_INVALIDDATA; + s->block = 0; s->ch_offset = 0; |