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 D773044E0A for ; Mon, 26 Dec 2022 22:01:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2077668BC4A; Tue, 27 Dec 2022 00:01:43 +0200 (EET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DA1D668BAD5 for ; Tue, 27 Dec 2022 00:01:35 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 0E1451BF209 for ; Mon, 26 Dec 2022 22:01:34 +0000 (UTC) Date: Mon, 26 Dec 2022 23:01:34 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20221226220134.GQ3806951@pb2> References: <20221225182812.18238-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/dts2pts_bsf: Avoid poc overflows in cmp_find() 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="===============0869628568446638501==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0869628568446638501== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GsUSTzGf3ObKA1Cs" Content-Disposition: inline --GsUSTzGf3ObKA1Cs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 26, 2022 at 03:48:41PM +0100, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: signed integer overflow: -2147483648 - 5 cannot be represented i= n type 'int' > > Fixes: 54242/clusterfuzz-testcase-minimized-ffmpeg_BSF_DTS2PTS_fuzzer-4= 72928339243827 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/dts2pts_bsf.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > >=20 > > diff --git a/libavcodec/dts2pts_bsf.c b/libavcodec/dts2pts_bsf.c > > index 48612e59db..60bec91f99 100644 > > --- a/libavcodec/dts2pts_bsf.c > > +++ b/libavcodec/dts2pts_bsf.c > > @@ -90,9 +90,11 @@ static int cmp_insert(const void *key, const void *n= ode) > > =20 > > static int cmp_find(const void *key, const void *node) > > { > > - int ret =3D ((const DTS2PTSFrame *)key)->poc - ((const DTS2PTSNode= *) node)->poc; > > + const DTS2PTSFrame * key1 =3D key; > > + const DTS2PTSNode *node1 =3D node; > > + int ret =3D (key1->poc > node1->poc) - (key1->poc < node1->poc) ; >=20 > Don't we have FFDIFFSIGN (or so) for this? yes, i must have forgotten will apply with FFDIFFSIGN() thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus --GsUSTzGf3ObKA1Cs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY6oZvQAKCRBhHseHBAsP qzAQAKCQduhwPo0NBCkFk+FfDSv+OmechQCfXh8SWuV8DUcvIy2BNR5v4jlbfsA= =pJ7o -----END PGP SIGNATURE----- --GsUSTzGf3ObKA1Cs-- --===============0869628568446638501== 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". --===============0869628568446638501==--