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 7C7AA4A5EA for ; Thu, 2 May 2024 21:32:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 87D3568D872; Fri, 3 May 2024 00:32:29 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 826FC68D85F for ; Fri, 3 May 2024 00:32:23 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 72AEF1C0005 for ; Thu, 2 May 2024 21:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714685542; 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=uWJiVaVzEV6zuESlqqOywv7ZGbaRjRWJW94TI7+nVGk=; b=WU7V+EpRvOyGHOHWSVtuQfgyQ99ABihbb5ssQq8ekU+0lbClv/Q8o5Vscu/OcGpIbC88Cq 2klhEajZCyCKyyFn2F/EpmHlz1zZt/PdUHfKwJpmJz2YuZH9rudxSHN2OYULQNNCIjhSEF 4k0pfN02mWuamwUfPXmpPhMmuoN2e0afmTNL+xRPmh7h7GBfWJ2A7ytLos0eZm/R6AqvLQ Xj1SqmRR0FklxwcPieLgfGt8jDNiJaAXsm7pEXy9MX1ZuIRhkYcbHlENvkdGogFawY1DRO Yj4Cr0TWQXLlm6Z0YeMLUDRu4beL5/zrhGaYciNgBuxX0kMB8phTsBGubti27A== Date: Thu, 2 May 2024 23:32:21 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240502213221.GF6420@pb2> References: <20240502004150.3627661-1-michael@niedermayer.cc> <20240502004150.3627661-4-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 4/7] avcodec/avs2_parser: Assert init_get_bits8() success with const size 15 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="===============7893382070665873943==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7893382070665873943== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="erF8uI8CUvRLUCES" Content-Disposition: inline --erF8uI8CUvRLUCES Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 02, 2024 at 10:25:24AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: CID1506708 Unchecked return value > >=20 > > Sponsored-by: Sovereign Tech Fund > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/avs2_parser.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > >=20 > > diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c > > index 200134f91db..8d4bc3cee0d 100644 > > --- a/libavcodec/avs2_parser.c > > +++ b/libavcodec/avs2_parser.c > > @@ -72,13 +72,15 @@ static void parse_avs2_seq_header(AVCodecParserCont= ext *s, const uint8_t *buf, > > unsigned aspect_ratio; > > unsigned frame_rate_code; > > int low_delay; > > + int ret; > > // update buf_size_min if parse more deeper > > const int buf_size_min =3D 15; > > =20 > > if (buf_size < buf_size_min) > > return; > > =20 > > - init_get_bits8(&gb, buf, buf_size_min); > > + ret =3D init_get_bits8(&gb, buf, buf_size_min); > > + av_assert2(ret >=3D 0); > > =20 > > s->key_frame =3D 1; > > s->pict_type =3D AV_PICTURE_TYPE_I; >=20 > Code like this may trigger set-but-unused variable warnings when > ASSERT_LEVEL is <=3D 1. Add av_unused to ret to fix this. > Apart from that, it should be av_assert1 (this is not hot). will apply with these changes thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes --erF8uI8CUvRLUCES Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZjQGZQAKCRBhHseHBAsP qwyJAJ4gyPiGQ1Yk10LNf0tTR4usF0ONYQCdEar+J1dbfWPS3JZ3M/Mhhlr6g4k= =d617 -----END PGP SIGNATURE----- --erF8uI8CUvRLUCES-- --===============7893382070665873943== 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". --===============7893382070665873943==--