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 3A4F943612 for ; Sat, 17 Sep 2022 21:17:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DBA2B68BB67; Sun, 18 Sep 2022 00:16:12 +0300 (EEST) 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 CBD9268BB5A for ; Sun, 18 Sep 2022 00:16:00 +0300 (EEST) 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 1oZfAO-00DrNV-CG for ffmpeg-devel@ffmpeg.org; Sat, 17 Sep 2022 23:16:00 +0200 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id Zf9moPPmm8s8UZfAOoEt8M; Sat, 17 Sep 2022 23:16:00 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id ZfAOoibLOOG5ZZfAOom24U; Sat, 17 Sep 2022 23:16:00 +0200 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=KJo5sHJo c=1 sm=1 tr=0 ts=63263910 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=NEAV23lmAAAA:8 a=2pjwXNU-MM44mZu5czYA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 17 Sep 2022 23:15:56 +0200 Message-Id: <20220917211557.11547-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220917211557.11547-1-michael@niedermayer.cc> References: <20220917211557.11547-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfP7EFXbA4RImoSaLqAEXsIfCQQWF1iv1q3/3CzxnAESKXU1qaD7Zz26MjdpyfXW+Q+0ZdaQI6rEcZD3MHrBBCzJigvpKyM9qUgb7cQoSZ6MdB9+C6t31 Q96ZaI1NgZ5SeZN4TiT25daFGVT3ihJA8cBV5GllxyDHmNHYY0QoFsO+EXq7FmsqMAgyBZrF32pumg== Subject: [FFmpeg-devel] [PATCH 8/9] avformat/icodec: Check nb_pal 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: Fixes: signed integer overflow: 538976288 * 4 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-6690068904935424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/icodec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/icodec.c b/libavformat/icodec.c index 290f658d0c0..85dab3bca0a 100644 --- a/libavformat/icodec.c +++ b/libavformat/icodec.c @@ -196,6 +196,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) AV_WL32(buf + 32, image->nb_pal); } + if (image->nb_pal > INT_MAX / 4 - 14 - 40) + return AVERROR_INVALIDDATA; + AV_WL32(buf - 4, 14 + 40 + image->nb_pal * 4); AV_WL32(buf + 8, AV_RL32(buf + 8) / 2); } -- 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".