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 3A43249024 for ; Mon, 1 Apr 2024 16:53:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6640568CDD1; Mon, 1 Apr 2024 19:53:26 +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 804DC68C903 for ; Mon, 1 Apr 2024 19:53:20 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D940B40003 for ; Mon, 1 Apr 2024 16:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1711990400; 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=tYmsEMgjZ0EsNtx3gxeTUmbJaxYUqT3w4GauA3ZcxGQ=; b=UWbjfBDSRHsxJTAt/ef3WX7SVzbBHfJjQ4/vs3PolgwaNaWxHC8F3cOYsR8bWLwnQwcs5S yQpH/F++bqNQI7j+o+SzipgEFfxOdvdSq2r3Daf/Ln2p4gt59GjiXHVW2HDDkXytfM03hj ojB5+Ur/OHRqn+RsHuIlRP3lSh9gVlXVgpd65DMDmSs7eM5pN6GAeZd4xxIF/O/XEKFPCc 6ETwdfywObbcp+KciJzoWlICJJkq70jibwcfQlCcsmAHVQTMlzILy+84sOGEcwBNei+J+g OH4SKuJQ4uxlGguxKa9cuB4aR0cNgmzWFauufbjOb1gfzOacYXLKtIx6BcwGtg== Date: Mon, 1 Apr 2024 18:53:19 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240401165319.GG6420@pb2> References: <20240331114019.3801-1-michael@niedermayer.cc> <6aa524e2-8686-4cc7-883c-30d281d9bcb0@gmail.com> <20240401153826.GB6420@pb2> <99636727-35e0-47d6-bd11-0c936cadcf76@gmail.com> MIME-Version: 1.0 In-Reply-To: <99636727-35e0-47d6-bd11-0c936cadcf76@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="===============0928172512800728646==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0928172512800728646== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nKIUeEB/1s3f72JD" Content-Disposition: inline --nKIUeEB/1s3f72JD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 01, 2024 at 12:45:36PM -0300, James Almer wrote: > 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, tr= ack->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, = AVPacket *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= ->dts - 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. A= nd > > > 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? > >=20 > > changing cts to 64bit does avoid the assert with the test sample but > >=20 > > 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 > >=20 > > theres also > > avio_wb32(pb, track->cluster[i].cts); > > in mov_write_trun_tag() >=20 > 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. ok, will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin --nKIUeEB/1s3f72JD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZgrmewAKCRBhHseHBAsP qwweAJ9U4Ub/GrZ64Y1swtSNa8r9AzaojACggdxLxy1LLyrmnQO/nRCdxltGHqM= =pOYj -----END PGP SIGNATURE----- --nKIUeEB/1s3f72JD-- --===============0928172512800728646== 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". --===============0928172512800728646==--