Module: libav
Branch: release/9
Commit: 5358f1b50753638628fa5b99afd4b7da20d62e22

Author:    Martin Storsjö <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Thu Sep 19 15:14:56 2013 +0300

asvdec: Verify the amount of extradata

The init function reads one byte of extradata.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
Signed-off-by: Martin Storsjö <[email protected]>
(cherry picked from commit f50803354c6acb4575379d7c54ca48ec5d36dd61)
Signed-off-by: Luca Barbato <[email protected]>

---

 libavcodec/asvdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c
index 16722a9..d3579de 100644
--- a/libavcodec/asvdec.c
+++ b/libavcodec/asvdec.c
@@ -285,6 +285,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
     const int scale       = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2;
     int i;
 
+    if (avctx->extradata_size < 1) {
+        av_log(avctx, AV_LOG_ERROR, "No extradata provided\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     ff_asv_common_init(avctx);
     init_vlcs(a);
     ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_asv_scantab);

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

Reply via email to