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 9C81E4ACF3 for ; Sun, 19 May 2024 19:50:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 51C8968D07E; Sun, 19 May 2024 22:50:41 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 77C8868D05A for ; Sun, 19 May 2024 22:50:34 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C5050C0003 for ; Sun, 19 May 2024 19:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716148233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZiA31nRWQEDuUXzWzBDkAG981pLml34oHNX5dGQZVDk=; b=CRnn5iPxHFEc/MwZjtRPtvBp6tcPzHfA6yDGnMrjEzlU4AEzR1u6JWEsGXtstg4274vACH VOf99fK9pXMP3lBnCP64U4l8Jy8+iOyrz62dU9owThfR7Lm/B+WxM59ntR7k8k458odpUH 06HZMc9e0v9+DtVPAEd6XiMsKkeIb8M7SD8+klJdbwUiVJ6dtrIMQeUexAiujK50+BFAns 0m3K55vsEI+vwmx8dM7JyiGUK9estOpiBWDVnL3buUfOhKVB337aBI0Pb4eyxg6uf27n6e GnAerrcu+7HD5Kb5UOXUIZXB5vWDZ7dfpJBJiAeHnAXgJKYiD3wxpIrr8Nr0VQ== Date: Sun, 19 May 2024 21:50:32 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240519195032.GN2821752@pb2> References: <20240513012011.1049366-1-michael@niedermayer.cc> <20240513012011.1049366-4-michael@niedermayer.cc> <45c0d7354d759fb7df0ca619ab9b73e1baaa3ba8.camel@intel.com> MIME-Version: 1.0 In-Reply-To: <45c0d7354d759fb7df0ca619ab9b73e1baaa3ba8.camel@intel.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 4/4] avcodec/qsvdec: Check av_image_get_buffer_size() for failure 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="===============3911576115113898470==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3911576115113898470== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tpyx7gKuSYt+mjHM" Content-Disposition: inline --tpyx7gKuSYt+mjHM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 13, 2024 at 01:47:36AM +0000, Xiang, Haihao wrote: > On Ma, 2024-05-13 at 03:20 +0200, Michael Niedermayer wrote: > > Fixes: CID1477406 Improper use of negative value > >=20 > > Sponsored-by: Sovereign Tech Fund > > Signed-off-by: Michael Niedermayer > > --- > > =A0libavcodec/qsvdec.c | 9 ++++++--- > > =A01 file changed, 6 insertions(+), 3 deletions(-) > >=20 > > diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c > > index ed0bfe4c8b8..a51ddace622 100644 > > --- a/libavcodec/qsvdec.c > > +++ b/libavcodec/qsvdec.c > > @@ -379,9 +379,12 @@ static int qsv_decode_init_context(AVCodecContext = *avctx, > > QSVContext *q, mfxVide > > =A0 > > =A0=A0=A0=A0 q->frame_info =3D param->mfx.FrameInfo; > > =A0 > > -=A0=A0=A0 if (!avctx->hw_frames_ctx) > > -=A0=A0=A0=A0=A0=A0=A0 q->pool =3D av_buffer_pool_init(av_image_get_buf= fer_size(avctx- > > >pix_fmt, > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 FFALIGN(avct= x->width, 128), FFALIGN(avctx->height, 64), > > 1), av_buffer_allocz); > > +=A0=A0=A0 if (!avctx->hw_frames_ctx) { > > +=A0=A0=A0=A0=A0=A0=A0 ret =3D av_image_get_buffer_size(avctx->pix_fmt,= FFALIGN(avctx->width, > > 128), FFALIGN(avctx->height, 64), 1); > > +=A0=A0=A0=A0=A0=A0=A0 if (ret < 0) > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return ret; > > +=A0=A0=A0=A0=A0=A0=A0 q->pool =3D av_buffer_pool_init(ret, av_buffer_a= llocz); > > +=A0=A0=A0 } > > =A0=A0=A0=A0 return 0; > > =A0} > > =A0 >=20 > LGTM, thx will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Elect your leaders based on what they did after the last election, not based on what they say before an election. --tpyx7gKuSYt+mjHM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZkpYCAAKCRBhHseHBAsP q0a/AJ9MIqquOM0QcVAUXANS4moYiFClFgCfYyAr+UhfyIX04FlTDzZpKBGSi0M= =SuR8 -----END PGP SIGNATURE----- --tpyx7gKuSYt+mjHM-- --===============3911576115113898470== 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". --===============3911576115113898470==--