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 126EA437CB for ; Sun, 28 Aug 2022 17:40:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EFB6968B988; Sun, 28 Aug 2022 20:40:00 +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 A547868B630 for ; Sun, 28 Aug 2022 20:39:54 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id EB24B20003 for ; Sun, 28 Aug 2022 17:39:53 +0000 (UTC) Date: Sun, 28 Aug 2022 19:39:53 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220828173953.GB2088045@pb2> References: <20220818223535.13078-1-michael@niedermayer.cc> <20220818223535.13078-4-michael@niedermayer.cc> <20220821142309.GI2088045@pb2> MIME-Version: 1.0 In-Reply-To: <20220821142309.GI2088045@pb2> 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="===============8820297832954204310==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8820297832954204310== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zF+zMOaY3GLhGz1l" Content-Disposition: inline --zF+zMOaY3GLhGz1l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 21, 2022 at 04:23:09PM +0200, Michael Niedermayer wrote: > 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_fuzze= r-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 *a= vctx, > > > 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? >=20 > We can increase the buffer size or change how the %8 !=3D 0 case is handl= ed > 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 ? ping [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides --zF+zMOaY3GLhGz1l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYwuoaAAKCRBhHseHBAsP qyb3AJ4tkIMvaU1o4SGG/JHMGVL7DuRN7QCdGzyfvV52uRnsUcWnSXtGZvWPS9U= =R7JG -----END PGP SIGNATURE----- --zF+zMOaY3GLhGz1l-- --===============8820297832954204310== 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". --===============8820297832954204310==--