From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 0BCF044FCD for ; Mon, 14 Jul 2025 18:59:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id B7B6E68EE10; Mon, 14 Jul 2025 21:59:00 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 7251268E215 for ; Mon, 14 Jul 2025 21:58:54 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B61BB4341E for ; Mon, 14 Jul 2025 18:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1752519533; 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=iAlZU11s2irmh2Or37911mn7kJYuvydsCV/hBQcJ6Dg=; b=SINhm+/Zo5gP543yHJ7hc6DBh1Hvb1r8RWgdJ1Bg+3Ai4t+G82CFDPVs07be824kJW+E9m 9OyGBrpUFnRIMNKLV8Hgy+FqHqvWEq3NxGkoQPqgC8V6CKwN9aGnZiu29ZqlKbMmOTxAHI lEUoEw3xLFkDT7i2mwGVxf6bOENUOqNSUbXkpZS2HcjU6KWsthS8UCtN5JLqaPPeEyCrkC MO/3jynLMYb5EPRuX6K1gYeDR3orkalRE6rqYiszqj0BOjLxMquRbiBkZjqXI3IqyLs2hw pdPhgHDBB8TygpXPfL/12/7ycCbRZYzwrzPISLq094/hl1OpCP2t31i/Q/sHmw== Date: Mon, 14 Jul 2025 20:58:52 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250714185852.GK29660@pb2> References: <20250713011030.1156550-1-michael@niedermayer.cc> <20250713011030.1156550-5-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdehvdejfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnheptefggedvffeiueffvefhiedtgfefjedukeefgeetgeevgeejgeekvdevjeelveeknecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepgedurdeiiedrieehrddujeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieehrddujeeipdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 5/5] avcodec/osq: Fix 32bit sample overflow 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="===============2405272929731823915==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2405272929731823915== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5gq2GTy/qDtxghF6" Content-Disposition: inline --5gq2GTy/qDtxghF6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 13, 2025 at 07:37:06PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: signed integer overflow: 2147483565 + 128 cannot be represented = in type 'int' > > Fixes: 428055715/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_= fuzzer-6358069900804096 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/osq.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/libavcodec/osq.c b/libavcodec/osq.c > > index 76090aa8d07..1d99ab32451 100644 > > --- a/libavcodec/osq.c > > +++ b/libavcodec/osq.c > > @@ -390,7 +390,7 @@ static int osq_decode_block(AVCodecContext *avctx, = AVFrame *frame) > > int32_t *src =3D s->decode_buffer[ch] + OFFSET; > > =20 > > for (int n =3D 0; n < nb_samples; n++) > > - dst[n] =3D av_clip_uint8(src[n] + 0x80); > > + dst[n] =3D av_clip_uint8(src[n] + 0x80ll); > > } > > break; > > case AV_SAMPLE_FMT_S16P: >=20 > Why do you use a 64bit intermediate instead of simply using unsigned > like we do everywhere else? we can use an unsigned but the intend was to clip obviously and while the C code uses 64bit the optimized asm should not need that Iam happy to change it to unsigned if you prefer [...] thx --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle --5gq2GTy/qDtxghF6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaHVTbAAKCRBhHseHBAsP q23KAJ49N/dXDleTA+8hurWrzF4q1bS9GgCfQmqgPtFdBLHQaj4MisEoxCfU1u4= =MM25 -----END PGP SIGNATURE----- --5gq2GTy/qDtxghF6-- --===============2405272929731823915== 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". --===============2405272929731823915==--