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 CBB0247A82 for ; Fri, 29 Sep 2023 23:20:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F3EAD68CC97; Sat, 30 Sep 2023 02:20:14 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8AF1E68CC9C for ; Sat, 30 Sep 2023 02:20:06 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id DEE33240006 for ; Fri, 29 Sep 2023 23:20:05 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 30 Sep 2023 01:19:59 +0200 Message-Id: <20230929232001.23197-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230929232001.23197-1-michael@niedermayer.cc> References: <20230929232001.23197-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/6] avformat/cafdec: saturate start + size into 64bit 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: 64 + 9223372036854775803 cannot be represented in type 'long long' Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6536881135550464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/cafdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index e92e3279fc6..0e50a3cfe68 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -435,7 +435,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) /* don't read past end of data chunk */ if (caf->data_size > 0) { - left = (caf->data_start + caf->data_size) - avio_tell(pb); + left = av_sat_add64(caf->data_start, caf->data_size) - avio_tell(pb); if (!left) return AVERROR_EOF; if (left < 0) -- 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".