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 2C41544813 for ; Mon, 26 Dec 2022 21:42:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 59FC568BB47; Mon, 26 Dec 2022 23:42:32 +0200 (EET) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 37E2C68B1AD for ; Mon, 26 Dec 2022 23:42:26 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 42ECF100003 for ; Mon, 26 Dec 2022 21:42:24 +0000 (UTC) Date: Mon, 26 Dec 2022 22:42:24 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20221226214224.GN3806951@pb2> References: <20221225220323.20968-1-michael@niedermayer.cc> <20221225220323.20968-2-michael@niedermayer.cc> <561091f8a80bbdfac9e50e305ec42ab58adbcde7.camel@haerdin.se> MIME-Version: 1.0 In-Reply-To: <561091f8a80bbdfac9e50e305ec42ab58adbcde7.camel@haerdin.se> Subject: Re: [FFmpeg-devel] [PATCH 2/2] avformat/mxfdec: Use 64bit in remainder 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="===============4764076466378288819==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4764076466378288819== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5djQcNpkH+ZOV4C9" Content-Disposition: inline --5djQcNpkH+ZOV4C9 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 26, 2022 at 11:36:28AM +0100, Tomas H=E4rdin wrote: > s=F6n 2022-12-25 klockan 23:03 +0100 skrev Michael Niedermayer: > > Fixes: signed integer overflow: 48000 * 223587 cannot be represented > > in type 'int' > > Fixes: 54513/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer- > > 5817594836025344 > >=20 > > Found-by: continuous fuzzing process=20 > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > =A0libavformat/mxfdec.c | 4 ++-- > > =A01 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > > index e6118e141d..6150c131ec 100644 > > --- a/libavformat/mxfdec.c > > +++ b/libavformat/mxfdec.c > > @@ -3857,8 +3857,8 @@ static int64_t > > mxf_compute_sample_count(MXFContext *mxf, AVStream *st, > > =A0=A0=A0=A0 if ((sample_rate.num / sample_rate.den) =3D=3D 48000) { > > =A0=A0=A0=A0=A0=A0=A0=A0 return av_rescale_q(edit_unit, sample_rate, tr= ack- > > >edit_rate); > > =A0=A0=A0=A0 } else { > > -=A0=A0=A0=A0=A0=A0=A0 int remainder =3D (sample_rate.num * time_base.n= um) % > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = (time_base.den * sample_rate.den); > > +=A0=A0=A0=A0=A0=A0=A0 int64_t remainder =3D (sample_rate.num * > > (int64_t)time_base.num) % > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = (time_base.den * (int64_t)sample_rate.den); > > =A0=A0=A0=A0=A0=A0=A0=A0 if (remainder) >=20 > Looks OK. Could use uint64_t also I think will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato --5djQcNpkH+ZOV4C9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY6oVQAAKCRBhHseHBAsP q6zGAKCRnyYvPGOJoPShp2C/nvzwfNnO+wCfYkTYZkT7y7HkP57xmmhBv/aOtw8= =DKH7 -----END PGP SIGNATURE----- --5djQcNpkH+ZOV4C9-- --===============4764076466378288819== 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". --===============4764076466378288819==--