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 4516B47D40 for ; Thu, 19 Oct 2023 16:55:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 18F2868CAFD; Thu, 19 Oct 2023 19:55:23 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D4FFD68CA49 for ; Thu, 19 Oct 2023 19:55:16 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 30044C0005 for ; Thu, 19 Oct 2023 16:55:15 +0000 (UTC) Date: Thu, 19 Oct 2023 18:55:15 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231019165515.GJ3543730@pb2> References: <20231018004935.18309-1-michael@niedermayer.cc> <20231018004935.18309-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/2] avcodec/hevc_ps: Dont leave invalid cpb_cnt_minus1 in the context 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="===============2643617706448917879==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2643617706448917879== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2MR/RMmd8g980bea" Content-Disposition: inline --2MR/RMmd8g980bea Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 18, 2023 at 03:17:41PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: index 32 out of bounds for type 'uint32_t [32]' > > Fixes: 63003/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-46851= 60840560640 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/hevc_ps.c | 1 + > > 1 file changed, 1 insertion(+) > >=20 > > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c > > index a6b64b92e3..f4365ef5b5 100644 > > --- a/libavcodec/hevc_ps.c > > +++ b/libavcodec/hevc_ps.c > > @@ -421,6 +421,7 @@ static int decode_hrd(GetBitContext *gb, int common= _inf_present, > > if (hdr->cpb_cnt_minus1[i] > 31) { > > av_log(NULL, AV_LOG_ERROR, "nb_cpb %d invalid\n", > > hdr->cpb_cnt_minus1[i]); > > + hdr->cpb_cnt_minus1[i] =3D 0; > > return AVERROR_INVALIDDATA; > > } > > } >=20 > There is a second issue here: There can be truncation during the > previous assignment, because cpb_cnt_minus1 is uint8_t. So this should > be fixed by properly checking the value and only putting it in the > parameter set after it has been validated (which also avoids having to > reset it). ok, will apply with that thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus --2MR/RMmd8g980bea Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZTFfcAAKCRBhHseHBAsP q6IaAJ47QHSnZEjsuoTd+Q0Ur0LdUntC9QCdFvOxApTmTYQNK/hj4wJe0paQEek= =78bm -----END PGP SIGNATURE----- --2MR/RMmd8g980bea-- --===============2643617706448917879== 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". --===============2643617706448917879==--