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 26F114124A for ; Wed, 16 Feb 2022 07:37:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 095C568B249; Wed, 16 Feb 2022 09:37:01 +0200 (EET) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 30A8B68B140 for ; Wed, 16 Feb 2022 09:36:54 +0200 (EET) Received: from 06d99489bb7677c9a95e511720568327 ([1.136.181.109]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id 21G7ahf6028302 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Wed, 16 Feb 2022 07:36:47 GMT Date: Wed, 16 Feb 2022 18:36:39 +1100 From: Peter Ross To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <20220215095808.1672019-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 In-Reply-To: <20220215095808.1672019-1-jiasheng@iscas.ac.cn> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/vp3: Add missing check for av_malloc 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="===============7674752388390965912==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7674752388390965912== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sux9lXHbjl8d8r7p" Content-Disposition: inline --sux9lXHbjl8d8r7p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 15, 2022 at 05:58:08PM +0800, Jiasheng Jiang wrote: > Since the av_malloc() may fail and return NULL pointer, > it is needed that the 's->edge_emu_buffer' should be checked > whether the new allocation is success. >=20 > Fixes: d14723861b ("VP3: fix decoding of videos with stride > 2048") > Signed-off-by: Jiasheng Jiang > --- > libavcodec/vp3.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c > index e9ab54d736..e2418eb6fa 100644 > --- a/libavcodec/vp3.c > +++ b/libavcodec/vp3.c > @@ -2679,8 +2679,13 @@ static int vp3_decode_frame(AVCodecContext *avctx, > AV_GET_BUFFER_FLAG_REF)) < 0) > goto error; > =20 > - if (!s->edge_emu_buffer) > + if (!s->edge_emu_buffer) { > s->edge_emu_buffer =3D av_malloc(9 * FFABS(s->current_frame.f->l= inesize[0])); > + if (!s->edge_emu_buffer) { > + ret =3D AVERROR(ENOMEM); > + goto error; > + } > + } > =20 looks good to me. i will apply in couple of days. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --sux9lXHbjl8d8r7p Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCYgypggAKCRBnYHnFrEDd a7rAAKCFs/JaSEbO/DVPd1RaeEdlxJi03gCeN+4xLscd4uagDevbkliLIR1gOAw= =ijc6 -----END PGP SIGNATURE----- --sux9lXHbjl8d8r7p-- --===============7674752388390965912== 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". --===============7674752388390965912==--