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 7C71A4FC6B for ; Sat, 28 Jun 2025 23:39:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 5B8B768E5F8; Sun, 29 Jun 2025 02:39:09 +0300 (EEST) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 8B1EE68DC7C for ; Sun, 29 Jun 2025 02:39:02 +0300 (EEST) Received: from 8790f245fd4b1a5c46c2d4b6fe5eafe1 ([1.136.108.129]) (authenticated (0 bits)) by mx.sdf.org (8.18.1/8.14.3) with ESMTPSA id 55SNcqFJ029415 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sat, 28 Jun 2025 23:38:58 GMT Date: Sun, 29 Jun 2025 09:38:50 +1000 From: Peter Ross To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <20250628002157.3665951-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: <20250628002157.3665951-1-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/rv60dec: Check ofs for overflows 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="===============4724031101268822467==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4724031101268822467== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h1iOgpXQiBs5+L71" Content-Disposition: inline --h1iOgpXQiBs5+L71 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 28, 2025 at 02:21:57AM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: 30 + 2147483647 cannot be represented in = type 'int' > Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_f= uzzer-6568264620900352 >=20 > Signed-off-by: Michael Niedermayer > --- > libavcodec/rv60dec.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c > index 6075598861d..4a3d9067db6 100644 > --- a/libavcodec/rv60dec.c > +++ b/libavcodec/rv60dec.c > @@ -2347,10 +2347,12 @@ static int rv60_decode_frame(AVCodecContext *avct= x, AVFrame * frame, > ofs =3D get_bits_count(&gb) / 8; > =20 > for (int i =3D 0; i < s->cu_height; i++) { > - if (header_size + ofs >=3D avpkt->size) > + if (ofs >=3D avpkt->size - header_size) > return AVERROR_INVALIDDATA; > s->slice[i].data =3D avpkt->data + header_size + ofs; > s->slice[i].data_size =3D FFMIN(s->slice[i].size, avpkt->size - = header_size - ofs); > + if (s->slice[i].size > INT32_MAX - ofs) > + return AVERROR_INVALIDDATA; > ofs +=3D s->slice[i].size; > } please apply -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --h1iOgpXQiBs5+L71 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCaGB9BwAKCRBnYHnFrEDd a712AJ9IETi7mJphx1VBm1mbPpXwsHlDlgCgujIglrEGa+5a6F89vk/QHGDR4rQ= =5cYt -----END PGP SIGNATURE----- --h1iOgpXQiBs5+L71-- --===============4724031101268822467== 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". --===============4724031101268822467==--