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 A45C142BB7 for ; Sat, 30 Apr 2022 19:26:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1D83E68B377; Sat, 30 Apr 2022 22:26:25 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 940B368AEAF for ; Sat, 30 Apr 2022 22:26:18 +0300 (EEST) 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 AA09AFF804 for ; Sat, 30 Apr 2022 19:26:17 +0000 (UTC) Date: Sat, 30 Apr 2022 21:26:16 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220430192616.GC396728@pb2> References: <20220405133747.318846-1-mvanb1@gmail.com> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] lavc/flacdec: Increase residual limit from INT_MAX to UINT_MAX 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="===============5072218290264433095==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5072218290264433095== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2JFBq9zoW8cOFH7v" Content-Disposition: inline --2JFBq9zoW8cOFH7v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 29, 2022 at 04:48:23PM +0200, Martijn van Beurden wrote: > Op wo 6 apr. 2022 om 09:12 schreef Martijn van Beurden : > > > > Op di 5 apr. 2022 om 15:37 schreef Martijn van Beurden : > > > > > > --- > > > libavcodec/flacdec.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c > > > index dd6026f9de..cb32d7cae8 100644 > > > --- a/libavcodec/flacdec.c > > > +++ b/libavcodec/flacdec.c > > > @@ -260,7 +260,7 @@ static int decode_residuals(FLACContext *s, int32= _t *decoded, int pred_order) > > > for (; i < samples; i++) > > > *decoded++ =3D get_sbits_long(&gb, tmp); > > > } else { > > > - int real_limit =3D tmp ? (INT_MAX >> tmp) + 2 : INT_MAX; > > > + int real_limit =3D (tmp > 1) ? (INT_MAX >> (tmp - 1)) + = 2 : INT_MAX; > > > for (; i < samples; i++) { > > > int v =3D get_sr_golomb_flac(&gb, tmp, real_limit, 1= ); > > > if (v =3D=3D 0x80000000){ > > > -- > > > 2.30.2 > > > > > > > A file needing this patch to decode properly can be found here: > > https://github.com/ktmf01/flac-test-files/blob/main/subset/63%20-%20pre= dictor%20overflow%20check%2C%2024-bit.flac > > > > Kind regards, Martijn van Beurden >=20 > Hereby I'd like to once more bring this patch to the attention of the > mailinglist. will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Take away the freedom of one citizen and you will be jailed, take away the freedom of all citizens and you will be congratulated by your peers in Parliament. --2JFBq9zoW8cOFH7v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYm2NVQAKCRBhHseHBAsP q2JVAJ4j17/fQoc4v9wlcIKf3tlFwOhGNgCbBJofV3+A0fs/T7oGo10e6FL6DKc= =q+BG -----END PGP SIGNATURE----- --2JFBq9zoW8cOFH7v-- --===============5072218290264433095== 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". --===============5072218290264433095==--