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 4C2BA49B2B for ; Mon, 3 Jun 2024 02:16:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 78B0468D69B; Mon, 3 Jun 2024 05:15:43 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E86968D694 for ; Mon, 3 Jun 2024 05:15:36 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D34EA1C0005 for ; Mon, 3 Jun 2024 02:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717380936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eBai6NNyMv+d6NUuavpEt6YF18+sEvDEQyUS/fMiyQ4=; b=P+RrtAN6PRBiiEXYrpW6YMzX63TLXt0UEMSXtk/mOPLn+P96LerHeJ6zPAfU1AM/0wOWUd Ek8dbPJxqQYSyyUhyKMXNoKsGXfJkImTvHM7ryT2ATQSAXX+uKGsYlZFP8nRD23++ZOl7z vyyqdqIBYeKg5LWKEgXAI7dwkZrFwec8nTBO0WT48wbM1A/GJhdELlg3ObImgMSho/4+uW jU/N53Z+flGK8HJX4VlmIKO4NP0k8k4TrjOI8pbQayfz0UrtuxquaomTl58WCO8PUqsg11 44F6yoGAkjr1SL2icbhbeL9WfIPWU7h8CvRKr3DdHO7R7oZZI/FkRHcsFRufAQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 3 Jun 2024 04:15:25 +0200 Message-ID: <20240603021526.2372698-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240603021526.2372698-1-michael@niedermayer.cc> References: <20240603021526.2372698-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 8/9] avformat/mov: Use 64bit in intermediate for current_dts 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 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: CID1500304 Unintentional integer overflow Fixes: CID1500318 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 45eca74d1db..d15b7b70c50 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3389,12 +3389,12 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) corrected_dts += sample_duration * sample_count; } - current_dts += sc->stts_data[i].duration * sample_count; + current_dts += sc->stts_data[i].duration * (int64_t)sample_count; if (current_dts > corrected_dts) { int64_t drift = (current_dts - corrected_dts)/FFMAX(sample_count, 1); uint32_t correction = (sc->stts_data[i].duration > drift) ? drift : sc->stts_data[i].duration - 1; - current_dts -= correction * sample_count; + current_dts -= correction * (uint64_t)sample_count; sc->stts_data[i].duration -= correction; } -- 2.45.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".