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 9E07D4476A for ; Thu, 22 Sep 2022 16:12:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14B9768BBD6; Thu, 22 Sep 2022 19:12:41 +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 03FE968BBCA for ; Thu, 22 Sep 2022 19:12:34 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id D9AA81C0007 for ; Thu, 22 Sep 2022 16:12:33 +0000 (UTC) Date: Thu, 22 Sep 2022 18:12:32 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220922161232.GL6583@pb2> References: <20220918171410.31835-1-michael@niedermayer.cc> <20220918171410.31835-10-michael@niedermayer.cc> <166385270026.3205.1761442577153286949@lain.khirnov.net> MIME-Version: 1.0 In-Reply-To: <166385270026.3205.1761442577153286949@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 10/13] avformat/vividas: Check packet size 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="===============1346937148722673186==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1346937148722673186== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NZiXfHLGvOGtDZMn" Content-Disposition: inline --NZiXfHLGvOGtDZMn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 22, 2022 at 03:18:20PM +0200, Anton Khirnov wrote: > Quoting Michael Niedermayer (2022-09-18 19:14:07) > > Fixes: signed integer overflow: 119760682 - -2084600173 cannot be repre= sented in type 'int' > > Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6= 745781167587328 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/vividas.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > >=20 > > diff --git a/libavformat/vividas.c b/libavformat/vividas.c > > index e9954f73ed0..22f61db7576 100644 > > --- a/libavformat/vividas.c > > +++ b/libavformat/vividas.c > > @@ -643,7 +643,9 @@ static int viv_read_packet(AVFormatContext *s, > > =20 > > if (viv->current_audio_subpacket < viv->n_audio_subpackets) { > > AVStream *astream; > > - int size =3D viv->audio_subpackets[viv->current_audio_subpacke= t+1].start - viv->audio_subpackets[viv->current_audio_subpacket].start; > > + int64_t size =3D viv->audio_subpackets[viv->current_audio_subp= acket+1].start - (int64_t)viv->audio_subpackets[viv->current_audio_subpacke= t].start; > > + if (size < 0 || size !=3D (int)size) > > + return AVERROR_INVALIDDATA; >=20 > These values should be checked in the loop where they are set. ok but then we fail before the actual problem is encountered i will send a patch doing that thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No human being will ever know the Truth, for even if they happen to say it by chance, they would not even known they had done so. -- Xenophanes --NZiXfHLGvOGtDZMn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYyyJbAAKCRBhHseHBAsP q+hQAJ9ywRDnFMDn/f4+bYB685DwKbgxgACffcnUtfm+uPOb7WrQjYyo4NpE9OI= =3qvU -----END PGP SIGNATURE----- --NZiXfHLGvOGtDZMn-- --===============1346937148722673186== 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". --===============1346937148722673186==--