From patchwork Tue May 2 15:38:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 41453 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp4092555pzb; Tue, 2 May 2023 08:38:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45HOD9sGwj5pZWfFFJrYFkacRFFNehx5mj5n/qoj7OJoRJG49XZ/y2oDS9vhuua2Q1JLY7 X-Received: by 2002:aa7:cb9a:0:b0:50b:d2f2:43f with SMTP id r26-20020aa7cb9a000000b0050bd2f2043fmr2275118edt.35.1683041919118; Tue, 02 May 2023 08:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683041919; cv=none; d=google.com; s=arc-20160816; b=lIfdxHCx2MnbdpnZVs490y+VgjNQq1s1j1yDVR3WryqcEXQe34BeoMKSCnPdYUUEqv JGRZtZXhr2A5MJDahm9viZtyxXI9JMa2Q3VgZq0m+6UOovhR5WcdSRAris+y9DE8r2up W0zXgQbPCtnSTLRRiW9TRXMPvz6eRlTl+A96US4CkHyWOqVWgdbS3rUPZ7+EDfrU+RLU yG4GTrXG5K3JKfuVxko/yH+9QwFiWRyqTQl1VIJWm5JiNy52PuJwcZ4X4fDQDqy9S5CN WMdYVRUkJk/Jlj07qzoF2gZaDyBUIyYsiZhejW50BLcJ06KHVZEfsxKniDJ8eKcESkpU dlaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=8usXCvmANpU90ONzrZRkICRaujESOsOADVe/IQSEjq0=; b=lgPoTJ/WcdmH/m+FBjnAAe7+3L8ma/Jd3d7I66kTOLvP6q9SBbqACjrQ6yq3hRzo9l Vh5Qeh3nZjgKvv1XCGh+5fHbXyvCm1Mul4hEwoW9lg75mEt1eVKjuniktG9bg7+PzVD/ oAyP9WF1khneIABT+T1+zl+ZA06VIFgZ9aQVU1q9nR9XNbRm4W2X/GGroOAEuJf7CGOb SvYc9eL/8DVUNvTlrnfHZHsjvL4tRXfb2ySXuAmtW1g2a4oCu0PTwtS90inRvmg4OmQf hKUaZXyRB7YIRlmL7Of88oazF+WUkXNghzAlTX/+AVnmaB9oHLIS8ccSit3IttHbDCQ8 ZZBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u9-20020aa7db89000000b005067441efb7si21275564edt.625.2023.05.02.08.38.38; Tue, 02 May 2023 08:38:39 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3181B68C180; Tue, 2 May 2023 18:38:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A420C68C152 for ; Tue, 2 May 2023 18:38:22 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id DAD33240004 for ; Tue, 2 May 2023 15:38:21 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 2 May 2023 17:38:19 +0200 Message-Id: <20230502153820.32234-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230502153820.32234-1-michael@niedermayer.cc> References: <20230502153820.32234-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/3] avformat/oggparsetheora: clip duration within 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: NJ/EjiRdpjVN Fixes: signed integer overflow: 9079256848778919936 - -288230376151711746 cannot be represented in type 'long' Fixes: 58248/clusterfuzz-testcase-minimized-ffmpeg_dem_OGG_fuzzer-6326851353313280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/oggparsetheora.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index b9184eff7b..85119352c3 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -196,7 +196,7 @@ static int theora_packet(AVFormatContext *s, int idx) if(s->streams[idx]->start_time == AV_NOPTS_VALUE && os->lastpts != AV_NOPTS_VALUE) { s->streams[idx]->start_time = os->lastpts; if (s->streams[idx]->duration > 0) - s->streams[idx]->duration -= s->streams[idx]->start_time; + s->streams[idx]->duration = av_sat_sub64(s->streams[idx]->duration, s->streams[idx]->start_time); } }