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 B46BB43656 for ; Wed, 20 Jul 2022 22:46:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9324868B7BF; Thu, 21 Jul 2022 01:46:46 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1977368B30F for ; Thu, 21 Jul 2022 01:46:40 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 667BF1BF203 for ; Wed, 20 Jul 2022 22:46:39 +0000 (UTC) Date: Thu, 21 Jul 2022 00:46:38 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220720224638.GD2088045@pb2> References: <20220719113453.23169-1-michael@niedermayer.cc> <20220719113453.23169-5-michael@niedermayer.cc> <20220720143013.GA2088045@pb2> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 5/6] avcodec/ffv1dec: consider run increase in minimal golomb frame size 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="===============0805635264839726574==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0805635264839726574== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7QsOHKuLbhbLTwLB" Content-Disposition: inline --7QsOHKuLbhbLTwLB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 21, 2022 at 12:17:22AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > On Tue, Jul 19, 2022 at 08:37:38AM -0300, James Almer wrote: > >> > >> > >> On 7/19/2022 8:34 AM, Michael Niedermayer wrote: > >>> Fixes: Timeout > >>> Fixes: 49160/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_f= uzzer-5672826144686080 > >>> > >>> Found-by: continuous fuzzing process https://github.com/google/oss-fu= zz/tree/master/projects/ffmpeg > >>> Signed-off-by: Michael Niedermayer > >>> --- > >>> libavcodec/ffv1dec.c | 6 +++++- > >>> 1 file changed, 5 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c > >>> index 01ddcaa512..9bdac0be4e 100644 > >>> --- a/libavcodec/ffv1dec.c > >>> +++ b/libavcodec/ffv1dec.c > >>> @@ -883,7 +883,11 @@ static int decode_frame(AVCodecContext *avctx, A= VFrame *rframe, > >>> if (buf_size < avctx->width * avctx->height / (128*8)) > >>> return AVERROR_INVALIDDATA; > >>> } else { > >>> - if (buf_size < avctx->height / 8) > >>> + int i; > >> > >> for (int i... > >=20 > > will apply with that change > >=20 > > thx > >=20 >=20 > James' suggestion made you use an uninitialized i in the actual check; yes > and even the original check is wrong, as one can overrun ff_log2_run > (unless there is a check that I am not missing).=20 Theres a check but its too late > So it seems to me that > reverting 15785e044ee1265464bb4f3ed727e2a8074f97b4 is appropriate. not against that but heres a quick fix attempt Author: Michael Niedermayer Date: Thu Jul 21 00:20:41 2022 +0200 avcodec/ffv1dec: Fix AC_GOLOMB_RICE min size check =20 Found-by: mkver =20 Signed-off-by: Michael Niedermayer diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index d71584505d..c6eca3227c 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -884,9 +884,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame= *rframe, return AVERROR_INVALIDDATA; } else { int w =3D avctx->width; - for (int i =3D 0; w > (1< (1<height + i + 6)/ 8) + if (buf_size < (avctx->height + s*i + 6)/ 8) return AVERROR_INVALIDDATA; } =20 =20 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt compla= in" "Best seller ever, very honest" - "Seller refunded buyer after failed scam" --7QsOHKuLbhbLTwLB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYtiFygAKCRBhHseHBAsP q16/AKCNEXIV51XQZFPW3iI9pWiqm0SWOwCeIzJj8MdLcJONxQx9lFpmmB5idpk= =InpT -----END PGP SIGNATURE----- --7QsOHKuLbhbLTwLB-- --===============0805635264839726574== 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". --===============0805635264839726574==--