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 0EAF447929 for ; Wed, 27 Sep 2023 21:13:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BD0A468CB37; Thu, 28 Sep 2023 00:12:59 +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 104C968CAC9 for ; Thu, 28 Sep 2023 00:12:53 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4550C1C0003 for ; Wed, 27 Sep 2023 21:12:51 +0000 (UTC) Date: Wed, 27 Sep 2023 23:12:50 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230927211250.GU3543730@pb2> References: <20230922191344.7018-1-michael@niedermayer.cc> <6e773fe7f18dfb8a06660b745bbc78d1afb935dc.camel@haerdin.se> MIME-Version: 1.0 In-Reply-To: <6e773fe7f18dfb8a06660b745bbc78d1afb935dc.camel@haerdin.se> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v3] avformat/mxfdec: Remove this_partition 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="===============4842349432702956599==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4842349432702956599== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9AazSAFPVKSPmRXK" Content-Disposition: inline --9AazSAFPVKSPmRXK Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi On Wed, Sep 27, 2023 at 01:37:40PM +0200, Tomas H=E4rdin wrote: > fre 2023-09-22 klockan 21:13 +0200 skrev Michael Niedermayer: > > Suggested-by: Tomas H=E4rdin > > Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer- > > 5130394286817280 > >=20 > > Signed-off-by: Michael Niedermayer > > --- > > =A0libavformat/mxfdec.c | 28 ++++++++++++++++++---------- > > =A01 file changed, 18 insertions(+), 10 deletions(-) > >=20 > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > > index 4846c5d206a..1313f14fa03 100644 > > --- a/libavformat/mxfdec.c > > +++ b/libavformat/mxfdec.c > > @@ -102,7 +102,6 @@ typedef struct MXFPartition { > > =A0=A0=A0=A0 uint64_t previous_partition; > > =A0=A0=A0=A0 int index_sid; > > =A0=A0=A0=A0 int body_sid; > > -=A0=A0=A0 int64_t this_partition; > > =A0=A0=A0=A0 int64_t essence_offset;=A0=A0=A0=A0=A0=A0=A0=A0 ///< absol= ute offset of essence > > =A0=A0=A0=A0 int64_t essence_length; > > =A0=A0=A0=A0 int32_t kag_size; > > @@ -727,10 +726,13 @@ static int mxf_read_partition_pack(void *arg, > > AVIOContext *pb, int tag, int size > > =A0=A0=A0=A0 UID op; > > =A0=A0=A0=A0 uint64_t footer_partition; > > =A0=A0=A0=A0 uint32_t nb_essence_containers; > > +=A0=A0=A0 uint64_t this_partition; > > =A0 > > =A0=A0=A0=A0 if (mxf->partitions_count >=3D INT_MAX / 2) > > =A0=A0=A0=A0=A0=A0=A0=A0 return AVERROR_INVALIDDATA; > > =A0 > > +=A0=A0=A0 av_assert0(klv_offset >=3D mxf->run_in); > > + > > =A0=A0=A0=A0 tmp_part =3D av_realloc_array(mxf->partitions, mxf- > > >partitions_count + 1, sizeof(*mxf->partitions)); > > =A0=A0=A0=A0 if (!tmp_part) > > =A0=A0=A0=A0=A0=A0=A0=A0 return AVERROR(ENOMEM); > > @@ -773,7 +775,13 @@ static int mxf_read_partition_pack(void *arg, > > AVIOContext *pb, int tag, int size > > =A0=A0=A0=A0 partition->complete =3D uid[14] > 2; > > =A0=A0=A0=A0 avio_skip(pb, 4); > > =A0=A0=A0=A0 partition->kag_size =3D avio_rb32(pb); > > -=A0=A0=A0 partition->this_partition =3D avio_rb64(pb); > > +=A0=A0=A0 this_partition =3D avio_rb64(pb); > > +=A0=A0=A0 if (this_partition !=3D klv_offset - mxf->run_in) { > > +=A0=A0=A0=A0=A0=A0=A0 av_log(mxf->fc, AV_LOG_WARNING, > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "this_partition %"PRId64" m= ismatches %"PRId64"\n", > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 this_partition, klv_offset = - mxf->run_in); >=20 > We might want to error out here, since this means offsets are likely to > be incorrect across the entire file. We have no files in FATE that > demonstrate this problem, and it pays to be strict when it comes to > MXF. This helps people writing new MXF muxers from writing broken ones. ok, should i ask for a sample here (so we maybe get a sample) or just error out with this message at AV_LOG_ERROR ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle --9AazSAFPVKSPmRXK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZRSazwAKCRBhHseHBAsP q5/JAJ9LEsxWCfEJrgPpoJhXOpioTMVbYACdEZm1w9hZrfPSwi17AeCaoQVXEAI= =TsS+ -----END PGP SIGNATURE----- --9AazSAFPVKSPmRXK-- --===============4842349432702956599== 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". --===============4842349432702956599==--