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 B5E0447855 for ; Tue, 26 Dec 2023 16:37:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 938C868CCAF; Tue, 26 Dec 2023 18:37:43 +0200 (EET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C596768CC6C for ; Tue, 26 Dec 2023 18:37:34 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id EB0491BF206 for ; Tue, 26 Dec 2023 16:37:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703608654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=xwkRJRs6Y8PwpLt3cmScrumn33iCYGN57OuvxpUJyHA=; b=bDEGLJCS52N7Vn8IF4G3pkhDRy6b1z62IyI64fg06z771DM+39WAsDo+KdV6dpZWLnI8SA YbvbwFmQpk52qho8C7vQLDnqcl/7zWdTF16igfYFiKTC6wc0KdtS2LqM6QCxi+63Yk7hds 6Mf/RgpMaC2WVsEhLp8rj5Pq8I52WDR6VuFRWhagLWdPRVQANdT/932OYurMbenFAayzzd n/vZVBFiwL9DmQV1JJsXclzIk5q8kPnftWLcNNpTUyRiBaJn8qr9UVZWzVJ5vhHPeSEp7N o7kcUefG3JLdA79ch/cdby73hBHyA3HEnxfvCAuUL5FHkYlO4o5aN3nCVr8qVQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 26 Dec 2023 17:37:31 +0100 Message-Id: <20231226163731.4147-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231226163731.4147-1-michael@niedermayer.cc> References: <20231226163731.4147-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/3] avformat/concatdec: clip outpoint - inpoint overflow in get_best_effort_duration() 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: An alternative would be to limit all time/duration fields to below 64bit Fixes: signed integer overflow: -93000000 - 9223372036839000000 cannot be represented in type 'long long' Fixes: 64546/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-5110813828186112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/concatdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 5a7a063ef7d..3da2ac9e705 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -323,7 +323,7 @@ static int64_t get_best_effort_duration(ConcatFile *file, AVFormatContext *avf) if (file->user_duration != AV_NOPTS_VALUE) return file->user_duration; if (file->outpoint != AV_NOPTS_VALUE) - return file->outpoint - file->file_inpoint; + return av_sat_sub64(file->outpoint, file->file_inpoint); if (avf->duration > 0) return avf->duration - (file->file_inpoint - file->file_start_time); if (file->next_dts != AV_NOPTS_VALUE) -- 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".