[FFmpeg-cvslog] wavpack: check packet size early

Luca Barbato git at videolan.org
Mon Jun 3 00:56:38 CEST 2013


ffmpeg | branch: release/1.1 | Luca Barbato <lu_zero at gentoo.org> | Wed May 22 12:51:42 2013 +0200| [93fbf034c94caf7ddfecd3c1947e3139fef6bfca] | committer: Reinhard Tartler

wavpack: check packet size early

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit fd06291239c1bb616bf303b5696cc432710b2530)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93fbf034c94caf7ddfecd3c1947e3139fef6bfca
---

 libavcodec/wavpack.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 96ea610..826b449 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;
 



More information about the ffmpeg-cvslog mailing list