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 9F4E243B15 for ; Thu, 12 Jan 2023 14:30:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7D9E68AFBB; Thu, 12 Jan 2023 16:30:43 +0200 (EET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0B3CB689D6F for ; Thu, 12 Jan 2023 16:30:36 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 3B10A2000B for ; Thu, 12 Jan 2023 14:30:35 +0000 (UTC) Date: Thu, 12 Jan 2023 15:30:35 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230112143035.GJ1949656@pb2> References: <20230111204221.22550-1-michael@niedermayer.cc> <20230111204221.22550-6-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 6/6] avcodec/bonk: Check ntaps against buffer 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="===============5683396277450820614==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5683396277450820614== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g3RkK9jYN81zD2N+" Content-Disposition: inline --g3RkK9jYN81zD2N+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 11, 2023 at 10:06:19PM +0100, Paul B Mahol wrote: > On 1/11/23, Michael Niedermayer wrote: > > Fixes: out of array read > > Fixes: > > 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-673= 9246658748416 > > > > Note: This issue was assigned to a unrelated theora bug > > > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/bonk.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c > > index 9e176d5477..061cc69a58 100644 > > --- a/libavcodec/bonk.c > > +++ b/libavcodec/bonk.c > > @@ -101,6 +101,10 @@ static av_cold int bonk_init(AVCodecContext *avctx) > > s->samples_per_packet =3D AV_RL16(avctx->extradata + 15); > > if (!s->samples_per_packet) > > return AVERROR(EINVAL); > > + > > + if (s->down_sampling * s->samples_per_packet < s->n_taps) > > + return AVERROR_INVALIDDATA; > > + > > s->max_framesize =3D s->samples_per_packet * avctx->ch_layout.nb_c= hannels > > * s->down_sampling * 16LL; > > if (s->max_framesize > (INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) = / 8) > > return AVERROR_INVALIDDATA; > > -- > > 2.17.1 >=20 > LGTM will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I do not agree with what you have to say, but I'll defend to the death your right to say it. -- Voltaire --g3RkK9jYN81zD2N+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY8AZiwAKCRBhHseHBAsP q+SCAKCGwFF/NzlLaC8TZ707WOJVxxYAMgCglXcvmqwwVEodqQIfcxfQYO/QOqo= =zN2z -----END PGP SIGNATURE----- --g3RkK9jYN81zD2N+-- --===============5683396277450820614== 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". --===============5683396277450820614==--