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 A4B454024F for ; Fri, 12 Jul 2024 14:59:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6D77C68DA2D; Fri, 12 Jul 2024 17:59:43 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B769068D891 for ; Fri, 12 Jul 2024 17:59:36 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E051740004 for ; Fri, 12 Jul 2024 14:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720796376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TyfOBuOn1xtfBMb9lPuoEIE7AnddUWpZuy4VBmDvY+0=; b=E5F14sd56ETO3WZyGElms3VOA89E/Eyb8k1Oitz5or2iD6Q5RpoIqm2bfZ3HZr2Wd+u8sL cQQKMTNx+YgYGkJUC5bkzTRwBNFf/U+HtNAMX3fIqnKLZS0pjoDGx1IjGqZa69bDfEHALs Rhg86GNV28hyDAdmi3Fj1dEjR5L5wBuX47qiRgac6VJsXYX8DrXgvx8zzcgr4xSMjZUogO WraikoQO1DSnmbk/d/DF5/Ulz46Mtt80DgSxwSLrgFZeSvdRzWaBwSviR2b5TNR1YKkfAc Xis6sY74YiV6IM0zouJXGUAamXftVMBsSljg8TLA3MgDgDxSBN6WOY75lfvfhA== Date: Fri, 12 Jul 2024 16:59:34 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240712145934.GO4991@pb2> References: <20240711233417.1896879-1-michael@niedermayer.cc> <20240711233417.1896879-5-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 05/22] avformat/matroskadec: Use int64_t 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="===============6812332700291947914==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6812332700291947914== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YQQMu+1WUtOZ6W1X" Content-Disposition: inline --YQQMu+1WUtOZ6W1X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 12, 2024 at 10:42:38AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > The length is 64bit that is passed into the functions. > > Alternatively the values can be checked before cast > >=20 > > Fixes: CID1604572 Overflowed return value > >=20 > > Sponsored-by: Sovereign Tech Fund > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/matroskadec.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > >=20 > > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c > > index aa28a37da4c..9914838698c 100644 > > --- a/libavformat/matroskadec.c > > +++ b/libavformat/matroskadec.c > > @@ -989,7 +989,7 @@ static int ebml_read_length(MatroskaDemuxContext *m= atroska, AVIOContext *pb, > > * Read the next element as an unsigned int. > > * Returns NEEDS_CHECKING unless size =3D=3D 0. > > */ > > -static int ebml_read_uint(AVIOContext *pb, int size, > > +static int ebml_read_uint(AVIOContext *pb, int64_t size, > > uint64_t default_value, uint64_t *num) > > { > > int n =3D 0; > > @@ -1010,7 +1010,7 @@ static int ebml_read_uint(AVIOContext *pb, int si= ze, > > * Read the next element as a signed int. > > * Returns NEEDS_CHECKING unless size =3D=3D 0. > > */ > > -static int ebml_read_sint(AVIOContext *pb, int size, > > +static int ebml_read_sint(AVIOContext *pb, int64_t size, > > int64_t default_value, int64_t *num) > > { > > int n =3D 1; > > @@ -1033,7 +1033,7 @@ static int ebml_read_sint(AVIOContext *pb, int si= ze, > > * Read the next element as a float. > > * Returns 0 if size =3D=3D 0, NEEDS_CHECKING or < 0 on obvious failur= e. > > */ > > -static int ebml_read_float(AVIOContext *pb, int size, > > +static int ebml_read_float(AVIOContext *pb, int64_t size, > > double default_value, double *num) > > { > > if (size =3D=3D 0) { >=20 > The values are already checked before that (via the max_lengths list). Patch droped teh issue is already marked as false positive as it was mixed with other fa= lse positive stuff thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In a rich man's house there is no place to spit but his face. -- Diogenes of Sinope --YQQMu+1WUtOZ6W1X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZpFE0wAKCRBhHseHBAsP q3AAAJ9v8Y9lAl+s6Y2Iw4Qhpvu1TgTtIQCgg23XPa2paiHgGVO4762ATNv5j2w= =PsYp -----END PGP SIGNATURE----- --YQQMu+1WUtOZ6W1X-- --===============6812332700291947914== 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". --===============6812332700291947914==--