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 0868C47E2D for ; Fri, 27 Oct 2023 19:43:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 50DDD68CB83; Fri, 27 Oct 2023 22:43:20 +0300 (EEST) 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 8D31068CB2C for ; Fri, 27 Oct 2023 22:43:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 790C420002 for ; Fri, 27 Oct 2023 19:43:12 +0000 (UTC) Date: Fri, 27 Oct 2023 21:43:11 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231027194311.GX3543730@pb2> References: <20231004225921.30287-1-michael@niedermayer.cc> <20231004225921.30287-2-michael@niedermayer.cc> <00e201da08ac$a70a7b10$f51f7130$@samsung.com> MIME-Version: 1.0 In-Reply-To: <00e201da08ac$a70a7b10$f51f7130$@samsung.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/4] avcodec/evc_parse: Check num_remaining_tiles_in_slice_minus1 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="===============1698939092704577124==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1698939092704577124== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gm7NYNn7ANaXHZ3B" Content-Disposition: inline --gm7NYNn7ANaXHZ3B Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 27, 2023 at 10:07:38AM +0200, Dawid Kozinski/Multimedia (PLT) /= SRPOL/Staff Engineer/Samsung Electronics wrote: >=20 >=20 >=20 >=20 > > -----Original Message----- > > From: ffmpeg-devel On Behalf Of > > Michael Niedermayer > > Sent: czwartek, 5 pa=C5=BAdziernika 2023 00:59 > > To: FFmpeg development discussions and patches > > Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/evc_parse: Check > > num_remaining_tiles_in_slice_minus1 > >=20 > > Fixes: out of array access > > Fixes: 62467/clusterfuzz-testcase-minimized- > > ffmpeg_BSF_EVC_FRAME_MERGE_fuzzer-6092990982258688 > >=20 > > Found-by: continuous fuzzing process > > https://protect2.fireeye.com/v1/url?k=3D10fdc12a-701f5c77-10fc4a65- > > 000babd9f1ba-c93ee30773aca891&q=3D1&e=3D409cddd0-bda7-445c-b76b- > > 1caf069ec3f8&u=3Dhttps%3A%2F%2Fgithub.com%2Fgoogle%2Foss- > > fuzz%2Ftree%2Fmaster%2Fprojects%2Fffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/evc_parse.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > >=20 > > diff --git a/libavcodec/evc_parse.c b/libavcodec/evc_parse.c index > > bd3a4416f2d..5ab33166cf3 100644 > > --- a/libavcodec/evc_parse.c > > +++ b/libavcodec/evc_parse.c > > @@ -58,8 +58,12 @@ int ff_evc_parse_slice_header(GetBitContext *gb, > > EVCParserSliceHeader *sh, > > if (!sh->arbitrary_slice_flag) > > sh->last_tile_id =3D get_bits(gb, pps->tile_id_len_minus1 = + 1); > > else { > > - sh->num_remaining_tiles_in_slice_minus1 =3D > get_ue_golomb_long(gb); > > - num_tiles_in_slice =3D sh->num_remaining_tiles_in_slice_mi= nus1 > + 2; > > + unsigned num_remaining_tiles_in_slice_minus1 =3D > > get_ue_golomb_long(gb); > > + if (num_remaining_tiles_in_slice_minus1 > EVC_MAX_TILE_ROW= S * > > EVC_MAX_TILE_COLUMNS - 2) > > + return AVERROR_INVALIDDATA; > > + > > + num_tiles_in_slice =3D num_remaining_tiles_in_slice_minus1= + 2; > > + sh->num_remaining_tiles_in_slice_minus1 =3D > > + num_remaining_tiles_in_slice_minus1; > > for (int i =3D 0; i < num_tiles_in_slice - 1; ++i) > > sh->delta_tile_id_minus1[i] =3D get_ue_golomb_long(gb); > > } > > -- > > 2.17.1 > >=20 >=20 > Reviewed and tested. It can be merged. will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Homeopathy is like voting while filling the ballot out with transparent ink. Sometimes the outcome one wanted occurs. Rarely its worse than filling out a ballot properly. --gm7NYNn7ANaXHZ3B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZTwSzAAKCRBhHseHBAsP qzxTAJ4l+CtbZZ+RcwWk7XjuYN1MhWnifwCggVew/gvW4sdl7bq70eA1VOj7tXc= =McaW -----END PGP SIGNATURE----- --gm7NYNn7ANaXHZ3B-- --===============1698939092704577124== 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". --===============1698939092704577124==--