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 19109426A8 for ; Tue, 22 Mar 2022 13:36:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7141A68B0E7; Tue, 22 Mar 2022 15:36:11 +0200 (EET) 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 DDCB16809C4 for ; Tue, 22 Mar 2022 15:36:04 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 2CDBC20009 for ; Tue, 22 Mar 2022 13:36:03 +0000 (UTC) Date: Tue, 22 Mar 2022 14:36:02 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220322133602.GR2829255@pb2> References: <20220201185239.13450-1-michael@niedermayer.cc> <20220201185239.13450-2-michael@niedermayer.cc> <232d5031-97f1-243a-92e4-879ccad9477e@gmail.com> MIME-Version: 1.0 In-Reply-To: <232d5031-97f1-243a-92e4-879ccad9477e@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH 2/2] avcodec/av1dec: Check tile_cols 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="===============1698849511531508591==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1698849511531508591== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VYtpT0p4un6JI1+2" Content-Disposition: inline --VYtpT0p4un6JI1+2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 21, 2022 at 06:03:12PM -0300, James Almer wrote: > On 2/1/2022 3:52 PM, Michael Niedermayer wrote: > > Fixes: division by zero > > Fixes: 43769/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzz= er-5392562205097984 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/av1dec.c | 3 +++ > > 1 file changed, 3 insertions(+) > >=20 > > diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c > > index 62d459cded..581f22a849 100644 > > --- a/libavcodec/av1dec.c > > +++ b/libavcodec/av1dec.c > > @@ -394,6 +394,9 @@ static int get_tiles_info(AVCodecContext *avctx, co= nst AV1RawTileGroup *tile_gro > > s->tg_start =3D tile_group->tg_start; > > s->tg_end =3D tile_group->tg_end; > > + if (s->raw_frame_header->tile_cols =3D=3D 0) >=20 > This should not happen. CBS should have returned an error instead or sett= ing > tile_cols to 0. > The bug should probably be fixed there. I didnt see your mail in time :( If you want, i can revert it? The issue seems that cbs av1 and av1dec disagree on how they handle redundant frames. I can "fix" it by=20 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1066,8 +1066,8 @@ static int av1_decode_frame(AVCodecContext *avctx, vo= id *frame, } break; case AV1_OBU_REDUNDANT_FRAME_HEADER: - if (s->raw_frame_header) - break; + // Unsupported + break; // fall-through case AV1_OBU_FRAME: case AV1_OBU_FRAME_HEADER: =20 cbs leaves tile_cols untouched (and 0) for the redundant frame =20 I didnt really look further, this probably should be looked at by someone who knows the av1dec/cbs code better. I can provide the sample file if someone wants to or also test any suggested fixes =20 I think this split logic where cbs and the decoder have to be kept in sync is a bit fragile. Or at least it looks fragile Thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you fake or manipulate statistics in a paper in physics you will never get a job again. If you fake or manipulate statistics in a paper in medicin you will get a job for life at the pharma industry. --VYtpT0p4un6JI1+2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYjnQvwAKCRBhHseHBAsP q5wzAJ9o0GTw9SXQj/lv3w1f8mNlEMTqfACdF8b2rDtUQSGg6KJfoMjCVa66kAI= =5x+0 -----END PGP SIGNATURE----- --VYtpT0p4un6JI1+2-- --===============1698849511531508591== 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". --===============1698849511531508591==--