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 81DFD46804 for ; Tue, 19 Sep 2023 18:18:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7E15168C866; Tue, 19 Sep 2023 21:18:45 +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 0920868C63C for ; Tue, 19 Sep 2023 21:18:38 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5CF011BF204 for ; Tue, 19 Sep 2023 18:18:38 +0000 (UTC) Date: Tue, 19 Sep 2023 20:18:37 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230919181837.GC8640@pb2> References: <20230918223534.23567-1-michael@niedermayer.cc> <20230918223534.23567-3-michael@niedermayer.cc> <3e76238d-d969-9d75-c0c2-ca29a3699d3b@gmail.com> MIME-Version: 1.0 In-Reply-To: <3e76238d-d969-9d75-c0c2-ca29a3699d3b@gmail.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 3/5] avcodec/dcadec: Do not explode EAGAIN 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="===============0901006694267792539==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0901006694267792539== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NWFdL9cNbHaIJHRV" Content-Disposition: inline --NWFdL9cNbHaIJHRV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 18, 2023 at 08:24:25PM -0300, James Almer wrote: > On 9/18/2023 7:35 PM, Michael Niedermayer wrote: > > Fixes: out of array access > > Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DCA_fuzz= er-6041088751960064 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/dcadec.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c > > index 3e3e3053bbe..070a9ae094d 100644 > > --- a/libavcodec/dcadec.c > > +++ b/libavcodec/dcadec.c > > @@ -221,7 +221,7 @@ static int dcadec_decode_frame(AVCodecContext *avct= x, AVFrame *frame, > > && (prev_packet & DCA_PACKET_XLL) > > && (s->packet & DCA_PACKET_CORE)) > > s->packet |=3D DCA_PACKET_XLL | DCA_PACKET_RECOVE= RY; > > - else if (ret =3D=3D AVERROR(ENOMEM) || (avctx->err_rec= ognition & AV_EF_EXPLODE)) > > + else if (ret =3D=3D AVERROR(ENOMEM) || (avctx->err_rec= ognition & AV_EF_EXPLODE) && ret !=3D AVERROR(EAGAIN)) > > return ret; > > } else { > > s->packet |=3D DCA_PACKET_XLL; >=20 > Maybe instead do >=20 > > diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c > > index 3e3e3053bb..3926115f21 100644 > > --- a/libavcodec/dcadec.c > > +++ b/libavcodec/dcadec.c > > @@ -217,11 +217,10 @@ static int dcadec_decode_frame(AVCodecContext *av= ctx, AVFrame *frame, > > if (asset && (asset->extension_mask & DCA_EXSS_XLL)) { > > if ((ret =3D ff_dca_xll_parse(&s->xll, input, asset)) < 0)= { > > // Conceal XLL synchronization error > > - if (ret =3D=3D AVERROR(EAGAIN) > > - && (prev_packet & DCA_PACKET_XLL) > > - && (s->packet & DCA_PACKET_CORE)) > > - s->packet |=3D DCA_PACKET_XLL | DCA_PACKET_RECOVER= Y; > > - else if (ret =3D=3D AVERROR(ENOMEM) || (avctx->err_rec= ognition & AV_EF_EXPLODE)) > > + if (ret =3D=3D AVERROR(EAGAIN) { > > + if ((prev_packet & DCA_PACKET_XLL) && (s->packet &= DCA_PACKET_CORE)) > > + s->packet |=3D DCA_PACKET_XLL | DCA_PACKET_REC= OVERY; > > + } else if (ret =3D=3D AVERROR(ENOMEM) || (avctx->err_r= ecognition & AV_EF_EXPLODE)) > > return ret; > > } else { > > s->packet |=3D DCA_PACKET_XLL; >=20 > So EAGAIN is handled in one place. ok will apply with you as author as its your change now thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein --NWFdL9cNbHaIJHRV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZQnl/QAKCRBhHseHBAsP q/FSAJsFZipO3vmQwXwUbax56rLjoSSLfQCgiLqG792yCSJGGyjiTPp3BdsnOJs= =Dfcw -----END PGP SIGNATURE----- --NWFdL9cNbHaIJHRV-- --===============0901006694267792539== 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". --===============0901006694267792539==--