Module: libav
Branch: master
Commit: ed50673066956d6f2201a57c3254569f2ab08d9d

Author:    Luca Barbato <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Fri May 17 18:29:15 2013 +0200

wavpack: validate samples size parsed in wavpack_decode_block

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]

---

 libavcodec/wavpack.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 38fc26b..8d7c82b 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -796,6 +796,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;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to