diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-05-22 12:51:42 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-05-31 23:00:31 +0200 |
commit | 93fbf034c94caf7ddfecd3c1947e3139fef6bfca (patch) | |
tree | 5cfe1ba088e090b30738fb78399e8ff70475d587 | |
parent | 10f77c165c3b3e881bb174a0f57dd62083639072 (diff) | |
download | ffmpeg-93fbf034c94caf7ddfecd3c1947e3139fef6bfca.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>
-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 96ea6103cc..826b449262 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1178,6 +1178,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; |