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 60040403FC for ; Sun, 21 Aug 2022 14:23:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DC80168B994; Sun, 21 Aug 2022 17:23:18 +0300 (EEST) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B86568B073 for ; Sun, 21 Aug 2022 17:23:12 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 03B9C240005 for ; Sun, 21 Aug 2022 14:23:10 +0000 (UTC) Date: Sun, 21 Aug 2022 16:23:09 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220821142309.GI2088045@pb2> References: <20220818223535.13078-1-michael@niedermayer.cc> <20220818223535.13078-4-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 4/4] avcodec/speedhq: Check width 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="===============8316441182389877006==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8316441182389877006== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GH2w3bbsGmSMo31z" Content-Disposition: inline --GH2w3bbsGmSMo31z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 21, 2022 at 12:54:57PM +0200, Paul B Mahol wrote: > On Fri, Aug 19, 2022 at 12:36 AM Michael Niedermayer > wrote: >=20 > > Fixes: out of array access > > Fixes: > > 50014/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEDHQ_fuzzer-= 4748914632294400 > > > > Alternatively the buffer size can be increased > > > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by > > : > > Michael Niedermayer > > --- > > libavcodec/speedhq.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c > > index c43de4f199..ffee5f973b 100644 > > --- a/libavcodec/speedhq.c > > +++ b/libavcodec/speedhq.c > > @@ -499,7 +499,7 @@ static int speedhq_decode_frame(AVCodecContext *avc= tx, > > AVFrame *frame, > > uint32_t second_field_offset; > > int ret; > > > > - if (buf_size < 4 || avctx->width < 8) > > + if (buf_size < 4 || avctx->width < 8 || avctx->width % 8 !=3D 0) > > return AVERROR_INVALIDDATA; > > >=20 > Is this right thing to do? We can increase the buffer size or change how the %8 !=3D 0 case is handled WIthout a non fuzzed file with such dimensions, I do not know what the correct handling of such a file is. What do you prefer to be done ? Thanks [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If the United States is serious about tackling the national security threat= s=20 related to an insecure 5G network, it needs to rethink the extent to which = it values corporate profits and government espionage over security.-Bruce Schn= eier --GH2w3bbsGmSMo31z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYwI/yQAKCRBhHseHBAsP q+NTAJ4+ICuRaSUbdKiO2bQTbnc1VDm8iACcCRwifyHDWgbAtdEaMY/u3Yz2TcQ= =4KpZ -----END PGP SIGNATURE----- --GH2w3bbsGmSMo31z-- --===============8316441182389877006== 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". --===============8316441182389877006==--