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 848794B75E for ; Fri, 12 Jul 2024 23:00:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8FE7A68DB01; Sat, 13 Jul 2024 02:00:19 +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 727E168D9DB for ; Sat, 13 Jul 2024 02:00:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5A0AD1BF207 for ; Fri, 12 Jul 2024 23:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720825212; 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=041voUXDkAbhFl564Y6zz2FsMm+0e7Re6GGp17pFK+U=; b=IvLI+xAHfRLu3PrOro284VzlNo9dSvPu1lMt4HVLMZ4AXPosjrY87HNqGHEzjJTBQApme8 pXP1vD8nBXIgPCPtYRepiMHZQSVPiqYKBf7UjFO9MEBzGEx31U7TyQipix2FKzMMXr3OEq YofIovHrP8F1hurfcyd5UlhWXUui2h0vZtgwjftmx5YuMtscUuHApq7jkzoYrroRbfzT1b l+xGPBPaCZx3ckhITNV3JtU5ktqCXt9W372QOevmxpGRBPqEMbfCpQmRS4+SdjVVAjpkJ2 dpPiojoBPRM8jGyvTvvLGSvFTVMP9sXnC/Cecx9Wt+TX20EO3jnvULDWbkQ5Yg== Date: Sat, 13 Jul 2024 01:00:11 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240712230011.GA4991@pb2> References: <20240520021944.361686-1-michael@niedermayer.cc> <20240520133655.GS2821752@pb2> MIME-Version: 1.0 In-Reply-To: <20240520133655.GS2821752@pb2> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avutil/hwcontext_drm: Check ioctl in drm_map_frame() 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="===============3829548076515226066==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3829548076515226066== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="88Sy+k7s/DRE8Hui" Content-Disposition: inline --88Sy+k7s/DRE8Hui Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 20, 2024 at 03:36:55PM +0200, Michael Niedermayer wrote: > On Mon, May 20, 2024 at 11:33:41AM +0200, Andreas Rheinhardt wrote: > > Michael Niedermayer: > > > Fixes: CID1583742 Unchecked return value > > >=20 > > > Sponsored-by: Sovereign Tech Fund > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavutil/hwcontext_drm.c | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > >=20 > > > diff --git a/libavutil/hwcontext_drm.c b/libavutil/hwcontext_drm.c > > > index 0847db09a08..e080c0597b8 100644 > > > --- a/libavutil/hwcontext_drm.c > > > +++ b/libavutil/hwcontext_drm.c > > > @@ -166,7 +166,10 @@ static int drm_map_frame(AVHWFramesContext *hwfc, > > > #if HAVE_LINUX_DMA_BUF_H > > > /* We're not checking for errors here because the kernel may= not > > > * support the ioctl, in which case its okay to carry on */ > > > - ioctl(desc->objects[i].fd, DMA_BUF_IOCTL_SYNC, &sync_start); > > > + if (ioctl(desc->objects[i].fd, DMA_BUF_IOCTL_SYNC, &sync_sta= rt) =3D=3D -1) { > > > + err =3D AVERROR(errno); > > > + goto fail; > > > + } > > > #endif > > > } > > > map->nb_regions =3D i; > >=20 > > Did you read the comment above the code? >=20 > Apparently not >=20 > patch droped, will mark this as intentional theres a 2nd ioctl() call in the file (drm_unmap_frame()), that has no comm= ent and no check Is that as intended or does it need some change ? (its CID1583743 Unchecked return value) thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle=20 --88Sy+k7s/DRE8Hui Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZpG1dwAKCRBhHseHBAsP q7AQAJwPOoxN1M9GeHCWUC1iGHOdmQaUSwCgi3PmLCHhwnSI1V8le2CGkmUZflQ= =xj5z -----END PGP SIGNATURE----- --88Sy+k7s/DRE8Hui-- --===============3829548076515226066== 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". --===============3829548076515226066==--