From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 2444B40F07 for ; Sat, 12 Mar 2022 23:54:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D42BE68B18A; Sun, 13 Mar 2022 01:54:49 +0200 (EET) Received: from vie01a-dmta-at03-1.mx.upcmail.net (vie01a-dmta-at03-1.mx.upcmail.net [62.179.121.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 572BA68807F for ; Sun, 13 Mar 2022 01:54:43 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nTBZL-000381-0G for ffmpeg-devel@ffmpeg.org; Sun, 13 Mar 2022 00:54:43 +0100 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id TBYNnKmMZSgGFTBYNn2xdA; Sun, 13 Mar 2022 00:53:43 +0100 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id TBXAnu2mdOPqFTBXAnBuwy; Sun, 13 Mar 2022 00:52:28 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=OcX7sjfY c=1 sm=1 tr=0 ts=622d324a a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=MvdBuqeq2cUPjsrB6X8A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 13 Mar 2022 00:52:25 +0100 Message-Id: <20220312235227.19626-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220312235227.19626-1-michael@niedermayer.cc> References: <20220312235227.19626-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfClUmHkzJA0O4bO65lRWcde1T6QZCHWLMvNu8x+cve2FR9D0Ls5vnFecRENuFcwqZHYuVdy3gSL1wqxh8h2kg8FDBNQhm6VlL3blwz4kfVeNDV7Ih/zq rUJrYjtfu1pY7tr50M0O256I5ZgACSn1gkgm/t+auJ52uQkw2B3Q8pc+lpDj8UmpyASZUg6OWiGqnA== Subject: [FFmpeg-devel] [PATCH 2/4] avformat/mxfdec: Check count in mxf_read_strong_ref_array() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Michael Niedermayer --- libavformat/mxfdec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index b85c10bf19..d7cdd22c8a 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -932,7 +932,13 @@ static int mxf_read_cryptographic_context(void *arg, AVIOContext *pb, int tag, i static int mxf_read_strong_ref_array(AVIOContext *pb, UID **refs, int *count) { - *count = avio_rb32(pb); + unsigned c = avio_rb32(pb); + + //avio_read() used int + if (c > INT_MAX / sizeof(UID)) + return AVERROR_PATCHWELCOME; + *count = c; + av_free(*refs); *refs = av_calloc(*count, sizeof(UID)); if (!*refs) { -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".