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 D305548FAF for ; Mon, 1 Apr 2024 15:38:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 75FF368CE0C; Mon, 1 Apr 2024 18:38:34 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9FB8C68C14A for ; Mon, 1 Apr 2024 18:38:28 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D8BAC40002 for ; Mon, 1 Apr 2024 15:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1711985908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PJVYuiV2sDQqbdnloRq55TlrB60DvB0BSjT1LhlnGUg=; b=eT4XvqEA4MXWyF9Fh7P61L1x2K74OzW13yZlFS0MgluiOVGPM1lgXWwNh8ysitbz5csT0H SF9oARoPcFHq/NZ/w2UwFspPmzkWe1GFjHCMCx8I3+7fVbH3ZWel9HOJiMhc/j/R295bux CBsqgztHIBV+nwjf1VRJMl6RiJ8HvDH9IRVOr3fdlNY1oYhOR8ZRtE0G5W8r+wsmVTDQGv mTX7qFzZjH+yAXqjFrZhd+U86qkMGQqPzC5XhygHH/+9CYcoRu8V+FKM2VqTuekHeyIO5i +ty1BVTZYHl7SM8NIRf/An3Fi/NMTFTXO07D1YTLZ73/qj+Et9PMqQ8S2Un4YA== Date: Mon, 1 Apr 2024 17:38:26 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240401153826.GB6420@pb2> References: <20240331114019.3801-1-michael@niedermayer.cc> <6aa524e2-8686-4cc7-883c-30d281d9bcb0@gmail.com> MIME-Version: 1.0 In-Reply-To: <6aa524e2-8686-4cc7-883c-30d281d9bcb0@gmail.com> X-GND-Sasl: michael@niedermayer.cc 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-Type: multipart/mixed; boundary="===============7901151241547527585==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7901151241547527585== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fjhJt8OCdNVDAVfC" Content-Disposition: inline --fjhJt8OCdNVDAVfC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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) <=3D 0 failed at libavformat/movenc.c:3694 > > Fixes: poc2 > >=20 > > Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/movenc.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > >=20 > > 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, AVPa= cket *pkt) > > if (ret < 0) > > return ret; > > + if (pkt->pts !=3D AV_NOPTS_VALUE && > > + (uint64_t)pkt->dts - pkt->pts !=3D (int32_t)((uint64_t)pkt->dt= s - pkt->pts)) { > > + av_log(s, AV_LOG_WARNING, "pts/dts pair unsupported\n"); > > + return AVERROR_PATCHWELCOME; > > + } >=20 > 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. >=20 > 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 (32= bit) 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() so the suggestion would avoid the assert but the code is not correct, now o= ne can maybe add support for this by switching to 64bit variants. But this needs t= o be backported too. and "64bit cts support" seems not ideal both because of complexity and beac= ause its not a bugfix I would prefer to keep a simple (easy backportable) bugfix for the releases. thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What does censorship reveal? It reveals fear. -- Julian Assange --fjhJt8OCdNVDAVfC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZgrU7gAKCRBhHseHBAsP q9xWAJ4oq3gpsT+wLYebgJk8BVI2xP+j8gCfXjofNuyQImfmo21HFPRYDV+xknY= =xj1j -----END PGP SIGNATURE----- --fjhJt8OCdNVDAVfC-- --===============7901151241547527585== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============7901151241547527585==--