[FFmpeg-cvslog] wavpack: validate samples size parsed in wavpack_decode_block

Luca Barbato git at videolan.org
Mon Jul 29 03:25:51 CEST 2013


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Fri May 17 18:29:15 2013 +0200| [6711d410dc130b889f1a85a8408dd5ff99b769bf] | committer: Reinhard Tartler

wavpack: validate samples size parsed in wavpack_decode_block

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

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

Conflicts:
	libavcodec/wavpack.c

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

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

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 1098873..7ceb947 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -790,6 +790,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;



More information about the ffmpeg-cvslog mailing list