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 67F174B5F3 for ; Thu, 8 Aug 2024 17:10:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CFE8C68D7D6; Thu, 8 Aug 2024 20:10:43 +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 4825268D7D6 for ; Thu, 8 Aug 2024 20:10:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 51B6F20003 for ; Thu, 8 Aug 2024 17:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1723137036; 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=wZhjpv5Jqx/rIPBMLj98DOt3XLLl+L880Y0QjFYexPg=; b=VnnFqtqr6RK5xdePn772NMDUqzp2AeaVbAQTsAMYtLnP1YXSTb9121VVlVP+wLNPhrwy9h RYojEbJvG/ICjOLXr+4KkmULrthxWBGyiovwg/f8nn5IAYH3V5XZ29zyP3mxcZA4GXb9LU LLFDkC83ud4d2tnzUfzBrCBSJD7om9PK7dOruteoGp/pVwGTtYIqVdru32FI7lMUAfbzM+ ZkdZ0m8EdksJNqjuXDdQMEnTP0xA4/UUBcVQe89HXnOXoF7r5Iv/q1J3dZLgDDGKZ0+bPe ptB1iWbuHplBRtPIYxc9dQ1dyx+O/NDvXDyHSUhi3vQ76KnWNiwOzKdoAv58Hw== Date: Thu, 8 Aug 2024 19:10:35 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240808171035.GA4991@pb2> References: <20240806221853.959177-1-michael@niedermayer.cc> <20240806221853.959177-6-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 6/6] avformat/wtvdec: Check length of read mpeg2_descriptor 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="===============4344675433016295120==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4344675433016295120== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BSskle/K7yEK2joQ" Content-Disposition: inline --BSskle/K7yEK2joQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 07, 2024 at 10:02:09AM +1000, Peter Ross wrote: > On Wed, Aug 07, 2024 at 12:18:53AM +0200, Michael Niedermayer wrote: > > Fixes: Use of uninitialized value > > Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-62869= 09377150976 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/wtvdec.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > >=20 > > diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c > > index 1a6c4c33481..730c7fca783 100644 > > --- a/libavformat/wtvdec.c > > +++ b/libavformat/wtvdec.c > > @@ -846,7 +846,8 @@ static int parse_chunks(AVFormatContext *s, int mod= e, int64_t seekts, int *len_p > > } > > =20 > > buf_size =3D FFMIN(len - consumed, sizeof(buf)); > > - avio_read(pb, buf, buf_size); > > + if (avio_read(pb, buf, buf_size) !=3D buf_size) > > + return AVERROR_INVALIDDATA; > > consumed +=3D buf_size; > > ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_s= ize, NULL, 0, 0, NULL); > > } >=20 > please apply will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Its not that you shouldnt use gotos but rather that you should write readable code and code with gotos often but not always is less readable --BSskle/K7yEK2joQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZrT8CwAKCRBhHseHBAsP q5dKAJ9PAvZoGDv3plRbzE42vV3loLmqjgCcCVSTadWOED5yXzRrT/vCZTGKhns= =s9TI -----END PGP SIGNATURE----- --BSskle/K7yEK2joQ-- --===============4344675433016295120== 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". --===============4344675433016295120==--