Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 9d00fb9d70ee8c0cc7002b89318c5be00f1bbdad Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?=E5=AD=99=E6=B5=A9=28=E6=99=93=E9=BB=91=29?= |
| 3 | <tony.sh@alibaba-inc.com> |
| 4 | Date: Tue, 29 Aug 2017 23:59:21 +0200 |
| 5 | Subject: [PATCH] avformat/mxfdec: Fix Sign error in mxf_read_primer_pack() |
| 6 | MIME-Version: 1.0 |
| 7 | Content-Type: text/plain; charset=UTF-8 |
| 8 | Content-Transfer-Encoding: 8bit |
| 9 | |
| 10 | Fixes: 20170829B.mxf |
| 11 | |
| 12 | Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com> |
| 13 | Found-by: Xiaohei and Wangchu from Alibaba Security Team |
| 14 | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
| 15 | |
| 16 | CVE: CVE-2017-14169 |
| 17 | Upstream-Status: Backport |
| 18 | |
| 19 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 20 | --- |
| 21 | libavformat/mxfdec.c | 2 +- |
| 22 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 23 | |
| 24 | diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c |
| 25 | index 6adb77d..91731a7 100644 |
| 26 | --- a/libavformat/mxfdec.c |
| 27 | +++ b/libavformat/mxfdec.c |
| 28 | @@ -500,7 +500,7 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U |
| 29 | avpriv_request_sample(pb, "Primer pack item length %d", item_len); |
| 30 | return AVERROR_PATCHWELCOME; |
| 31 | } |
| 32 | - if (item_num > 65536) { |
| 33 | + if (item_num > 65536 || item_num < 0) { |
| 34 | av_log(mxf->fc, AV_LOG_ERROR, "item_num %d is too large\n", item_num); |
| 35 | return AVERROR_INVALIDDATA; |
| 36 | } |
| 37 | -- |
| 38 | 2.1.0 |
| 39 | |