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 D63B348AF8 for ; Mon, 1 Apr 2024 15:45:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2E95B68CE0C; Mon, 1 Apr 2024 18:45:39 +0300 (EEST) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9670A68C1BC for ; Mon, 1 Apr 2024 18:45:33 +0300 (EEST) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1def3340682so36238225ad.1 for ; Mon, 01 Apr 2024 08:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711986331; x=1712591131; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=AVNXXKXCnOtvD7DUY4eFgczof4ADJbwNKYU+gOxeAHY=; b=d0QdK28udgnEDjjVBfg4juyfL45YDft0e0oZ/bDJ2fJhq9LoFM2y4FMtEBRsz4Z6gA 18J4LtEgrcN/bOc2fcVvp0XNfihqMLBRfJUsauXoL/7Nub186cCHkyQvw2XjNtk2/4jQ VgsmL9hLycQTWBC2HeK7NhcrJLWCW0dRLeHi8ajjvseNlvJtZFKY+qYJj7mAtCbYpVcn QAkfPcJGikN9uqXD93SMhtxtqaztFsPAA5tc3pJW7Mb8A4FKbHVtM/1KvBB98RsJnRT1 Zzo3D9iQcB18rqtNnbuUKVXvmckRIoRcLsQsUwVBMQVl4T7fHHfrLEiRTVnJqjOqPSZo MZvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711986331; x=1712591131; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AVNXXKXCnOtvD7DUY4eFgczof4ADJbwNKYU+gOxeAHY=; b=DcDBl9eOWmKGurYiFICHDHS9Iaw9qbqd521Sg0n7wbM1vNsxQ605K0/ZVTKBIym20l 3hn8tLpsld3+VW5aURa/gUjZLolE5KZxzciaR2CtRO+ascjVtRYI9Q9ej2wi4E1S0p2u MSfIbtnoOtg3/RjbiBR7KXDmyCqf+zVaAbC1/s4ezdILo7GH1K6fl9OvbP1vSl+57ESZ M02fY1BS5Pb52grV8CTk7P7jyvWMNnzeRpSgZdaFc2sgVqhX0sLmlneHMqrUzng3RqF8 xR/DoeccF0VOHB0x+10coGXQbfQxabxC/ah/npgW0uV8/WKd+FQRaUjAXhZHLIQi2vj8 RdrA== X-Gm-Message-State: AOJu0Yze/Q6LkbpXbi/EdcI+DkzGirdPcfcphvzHpn/MmVY6hb4vCugf 0z+AK3A4BfezulO/WYL1RAUzLWqkyMopHXIuLXigzoYJkC14GA/C4P2OgYRQ X-Google-Smtp-Source: AGHT+IHEo0uoePjQMQA3qG0jUvsX92e6lVsQfUzYOsIDMMHqIH3+AlDm+NLF9VSinPVB8Vx0QpAL3g== X-Received: by 2002:a17:902:f391:b0:1e1:a74:5531 with SMTP id f17-20020a170902f39100b001e10a745531mr7654824ple.36.1711986325108; Mon, 01 Apr 2024 08:45:25 -0700 (PDT) Received: from [192.168.0.15] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id y2-20020a170902864200b001e2602fd756sm414544plt.95.2024.04.01.08.45.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Apr 2024 08:45:24 -0700 (PDT) Message-ID: <99636727-35e0-47d6-bd11-0c936cadcf76@gmail.com> Date: Mon, 1 Apr 2024 12:45:36 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240331114019.3801-1-michael@niedermayer.cc> <6aa524e2-8686-4cc7-883c-30d281d9bcb0@gmail.com> <20240401153826.GB6420@pb2> Content-Language: en-US From: James Almer In-Reply-To: <20240401153826.GB6420@pb2> Subject: Re: [FFmpeg-devel] [PATCH] avformat/movenc: Check that cts fits in 32bit 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 4/1/2024 12:38 PM, Michael Niedermayer wrote: > On Sun, Mar 31, 2024 at 01:30:26PM -0300, James Almer wrote: >> On 3/31/2024 8:40 AM, Michael Niedermayer wrote: >>> Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, track->timescale, AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694 >>> Fixes: poc2 >>> >>> Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory >>> Signed-off-by: Michael Niedermayer >>> --- >>> libavformat/movenc.c | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c >>> index ae94d8d5959..5617a2620c5 100644 >>> --- a/libavformat/movenc.c >>> +++ b/libavformat/movenc.c >>> @@ -6194,6 +6194,12 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) >>> if (ret < 0) >>> return ret; >>> + if (pkt->pts != AV_NOPTS_VALUE && >>> + (uint64_t)pkt->dts - pkt->pts != (int32_t)((uint64_t)pkt->dts - pkt->pts)) { >>> + av_log(s, AV_LOG_WARNING, "pts/dts pair unsupported\n"); >>> + return AVERROR_PATCHWELCOME; >>> + } >> >> Any such check should happen in check_pkt(), called directly above. And >> afaict there's no reason to not support 64bit cts. Even in >> mov_write_edts_tag() we check for it and write a version 1 of the box that >> supports 64bit values. >> >> Maybe the problem is that MOVIentry.cts is an int, when it should be an >> int64_t like start_cts? Can you test the following? > > changing cts to 64bit does avoid the assert with the test sample but > > If you chaneg cts to 64bit consider cts is assigned to MOVCtts duration (32bit) > in mov_write_ctts_tag() and also compared to it. > its also written with avio_wb32() later > > theres also > avio_wb32(pb, track->cluster[i].cts); > in mov_write_trun_tag() You're right, there's no 64bit version for these, i guess they will not define one either in a future revision of the spec. So your patch should be fine. > > so the suggestion would avoid the assert but the code is not correct, now one can > maybe add support for this by switching to 64bit variants. But this needs to be > backported too. > and "64bit cts support" seems not ideal both because of complexity and beacause > its not a bugfix > > I would prefer to keep a simple (easy backportable) bugfix for the releases. > > thx > > [...] > > > _______________________________________________ > 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". _______________________________________________ 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".