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 A5F514A0D4 for ; Wed, 20 Mar 2024 13:12:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B054568D46F; Wed, 20 Mar 2024 15:12:23 +0200 (EET) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5F59A68D454 for ; Wed, 20 Mar 2024 15:12:17 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id BAAF4E0005 for ; Wed, 20 Mar 2024 13:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1710940336; 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=Ve76/7IXPhSoqBv/Lsvji2UBTIwrjm8SR31v0BDOBOM=; b=Wf/GrccBUtWOHnKWt1IJd8VLvqkU+n0Il1EpRh0wGTNn68W8Uld9mmcXy0Rl2dmLdInq0S INdATlD85O3WQfWwUHJcj7GICeqNsfDLCRqlJrIiWEoOaHcffHlzVNk+9NhXAUQNN9jQQg HWQK9yaWisy6Hok11Wq1QXMbo3zPeu3YsuF6kKMH/a3J5tinati0AuyCc9kA1Ii9k9PlHF plpKptaqkoVZprdNeSu5In5MTLRj7+UDVpTtho89WP2sqfv6C6iapjbraSshJ7WmrEEb5K JYyC3bPyy7s+aSAqOHcv4xI5aC0Twhx6475B+cuBzMYJMIAShH963xcFo0ND7g== Date: Wed, 20 Mar 2024 14:12:16 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240320131216.GR6420@pb2> References: <20240320025923.3794-1-michael@niedermayer.cc> <092a8cd44e3074e2d0462052e715281c08eb31b9.camel@haerdin.se> MIME-Version: 1.0 In-Reply-To: <092a8cd44e3074e2d0462052e715281c08eb31b9.camel@haerdin.se> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/4] avcodec/jpeg2000htdec: Check M_b / magp before using it in a shift 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="===============8036953030422211161==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8036953030422211161== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IRi8wqNWHPaOhEey" Content-Disposition: inline --IRi8wqNWHPaOhEey Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2024 at 12:20:11PM +0100, Tomas H=E4rdin wrote: > ons 2024-03-20 klockan 03:59 +0100 skrev Michael Niedermayer: > > Fixes: shift exponent -1 is negative > > Fixes: 65378/clusterfuzz-testcase-minimized- > > ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5457678193197056 > >=20 > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > =A0libavcodec/jpeg2000htdec.c | 3 +++ > > =A01 file changed, 3 insertions(+) > >=20 > > diff --git a/libavcodec/jpeg2000htdec.c b/libavcodec/jpeg2000htdec.c > > index 6b9898d3ff..0b94bb5da2 100644 > > --- a/libavcodec/jpeg2000htdec.c > > +++ b/libavcodec/jpeg2000htdec.c > > @@ -1193,6 +1193,9 @@ ff_jpeg2000_decode_htj2k(const > > Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c > > =A0 > > =A0=A0=A0=A0 int32_t M_b =3D magp; > > =A0 > > +=A0=A0=A0 if (magp >=3D 31) > > +=A0=A0=A0=A0=A0=A0=A0 return AVERROR_INVALIDDATA; >=20 > This isn't where the error is, assuming it even is an error. It's > either expn or nguardbits that are wrong, and they should be detected > and reported as such in jpeg2000dec.c. Checking this in every call to > ff_jpeg2000_decode_htj2k() is wasteful. >=20 > nguardbits can be 0..7 and expn can be 0..31. Table A.11 indicates that > Ssize can be up to 38 bits, so M_b >=3D 31 is in fact perfectly valid. > A > more appropriate error might be AVERROR_PATCHWELCOME. indeed, i will change it to AVERROR_PATCHWELCOME thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. --IRi8wqNWHPaOhEey Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZfrgqQAKCRBhHseHBAsP qyedAJ0dH5Zq6W3uTyon3HPuja9MKflp0ACglQuJfupkW4g4s8gE+qinb1SDMw4= =Fz6j -----END PGP SIGNATURE----- --IRi8wqNWHPaOhEey-- --===============8036953030422211161== 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". --===============8036953030422211161==--