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 61062400A6 for ; Sat, 19 Mar 2022 22:54:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D058268B124; Sun, 20 Mar 2022 00:54:55 +0200 (EET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B4C9268AA3E for ; Sun, 20 Mar 2022 00:54:49 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 1609220002 for ; Sat, 19 Mar 2022 22:54:48 +0000 (UTC) Date: Sat, 19 Mar 2022 23:54:48 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220319225448.GE2829255@pb2> References: <20220312235227.19626-1-michael@niedermayer.cc> <20220312235227.19626-3-michael@niedermayer.cc> <95bf35d01dc506dc0aeb2defd0e94040e6ee4e40.camel@acc.umu.se> MIME-Version: 1.0 In-Reply-To: <95bf35d01dc506dc0aeb2defd0e94040e6ee4e40.camel@acc.umu.se> Subject: Re: [FFmpeg-devel] [PATCH 3/4] avformat/mxfdec: Check for avio_read() failure in mxf_read_strong_ref_array() 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="===============8703548215535181122==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8703548215535181122== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o/NWWBMRgqVrTAcB" Content-Disposition: inline --o/NWWBMRgqVrTAcB Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2022 at 08:21:04PM +0100, Tomas H=E4rdin wrote: > s=F6n 2022-03-13 klockan 00:52 +0100 skrev Michael Niedermayer: > > Signed-off-by: Michael Niedermayer > > --- > > =A0libavformat/mxfdec.c | 8 +++++++- > > =A01 file changed, 7 insertions(+), 1 deletion(-) > >=20 > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > > index d7cdd22c8a..828fc0f9f1 100644 > > --- a/libavformat/mxfdec.c > > +++ b/libavformat/mxfdec.c > > @@ -932,6 +932,7 @@ static int mxf_read_cryptographic_context(void > > *arg, AVIOContext *pb, int tag, i > > =A0 > > =A0static int mxf_read_strong_ref_array(AVIOContext *pb, UID **refs, > > int *count) > > =A0{ > > +=A0=A0=A0 int64_t ret; > > =A0=A0=A0=A0 unsigned c =3D avio_rb32(pb); > > =A0 > > =A0=A0=A0=A0 //avio_read() used int > > @@ -946,7 +947,12 @@ static int mxf_read_strong_ref_array(AVIOContext > > *pb, UID **refs, int *count) > > =A0=A0=A0=A0=A0=A0=A0=A0 return AVERROR(ENOMEM); > > =A0=A0=A0=A0 } > > =A0=A0=A0=A0 avio_skip(pb, 4); /* useless size of objects, always 16 > > according to specs */ > > -=A0=A0=A0 avio_read(pb, (uint8_t *)*refs, *count * sizeof(UID)); > > +=A0=A0=A0 ret =3D avio_read(pb, (uint8_t *)*refs, *count * sizeof(UID)= ); > > +=A0=A0=A0 if (ret !=3D *count * sizeof(UID)) { > > +=A0=A0=A0=A0=A0=A0=A0 *count =3D ret < 0 ? 0=A0=A0 : ret / sizeof(UID); > > +=A0=A0=A0=A0=A0=A0=A0 return=A0=A0 ret < 0 ? ret : AVERROR_INVALIDDATA; >=20 > Looks ok i will apply once we agree on the previous patch as that is on top of it thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Asymptotically faster algorithms should always be preferred if you have asymptotical amounts of data --o/NWWBMRgqVrTAcB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYjZfOAAKCRBhHseHBAsP q1StAJ9QoOd7ZGK44oUgNjIcK9LjJNf8HQCfYknX9sYuQDx+xq05YTPXgvQKMRs= =xA/c -----END PGP SIGNATURE----- --o/NWWBMRgqVrTAcB-- --===============8703548215535181122== 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". --===============8703548215535181122==--