diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-05-22 12:51:42 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-06-22 08:51:56 +0200 |
commit | 42fed7f433e6d2167ffd4aae31905b583a53b988 (patch) | |
tree | b24ddefa8829706293deca9f6075446b1b67191f /libavcodec | |
parent | 7ca8d8223db270deb86d78b6361bec846feaaa9d (diff) | |
download | ffmpeg-42fed7f433e6d2167ffd4aae31905b583a53b988.tar.gz |
wavpack: check packet size early
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit fd06291239c1bb616bf303b5696cc432710b2530)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-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 7ceb947adb..59d735fab5 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1171,6 +1171,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; |