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 BC76449345 for ; Wed, 8 May 2024 20:04:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 35DE368D6FE; Wed, 8 May 2024 23:04:21 +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 E6DCC68BC2E for ; Wed, 8 May 2024 23:04:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B3F9BC0003 for ; Wed, 8 May 2024 20:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1715198652; 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=w1HyW7kmclJhUqaN3OPyE4C3b8iS2W1lrQ2kSBrV8HE=; b=T8/wY8IludWvxLYPOBEHIglz77cUYs1kKfsWu4p0pEs7uqtXIL05zzXcERaigjv+FWLE3q 2DkcNyh6Jy4llykLgtNhO3F0h6s3dF1bY82FkE18z7FcV8lURFDhi29xhUE0bV/jDqwVYk CAv+zbS/bJTxL1GAgqO9w1OKweSGuHrtW+2aGsY/Ff9h1MzJ61p7fV6TcAu5915Qw8Jq7z iirbapcGTCnAedRX1a+Skd6me5BP7dOSMRXzRin1m7wFnB1T1vXN6491um9ckF9hcshEHy UHr/6FkoYkRAxDfj/8O1JYB8NTNvfpiMDI9MvttoxT9NgBR3ynEiqwjMxYntjA== Date: Wed, 8 May 2024 22:04:11 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240508200411.GH6420@pb2> References: <20240508023923.28209-1-michael@niedermayer.cc> <20240508023923.28209-3-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 3/3] avformat/img2dec: assert no pipe on ts_from_file 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="===============6641358873715341485==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6641358873715341485== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pNqwZkzUt4Yweo7t" Content-Disposition: inline --pNqwZkzUt4Yweo7t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 08, 2024 at 12:16:44PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Help coverity with CID500302 Uninitialized scalar variable > >=20 > > Sponsored-by: Sovereign Tech Fund > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/img2dec.c | 2 ++ > > 1 file changed, 2 insertions(+) > >=20 > > diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c > > index a40675d4341..6220003fb4d 100644 > > --- a/libavformat/img2dec.c > > +++ b/libavformat/img2dec.c > > @@ -25,6 +25,7 @@ > > #define _DEFAULT_SOURCE > > #define _BSD_SOURCE > > #include > > +#include "libavutil/avassert.h" > > #include "libavutil/avstring.h" > > #include "libavutil/log.h" > > #include "libavutil/mem.h" > > @@ -504,6 +505,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacke= t *pkt) > > pkt->flags |=3D AV_PKT_FLAG_KEY; > > if (s->ts_from_file) { > > struct stat img_stat; > > + av_assert0(!s->is_pipe); > > if (stat(filename, &img_stat)) { > > res =3D AVERROR(EIO); > > goto fail; >=20 > 1. You seem to refer to 1500302 yes, fixed locally > which I can't even select any more > because it has been dismissed. no, it can be selected, it works here on the 3rd try coverity sometimes ignores selecting issues sometimes it displayes a long list of unrelated issues sometimes it works > 2. Why are you using av_assert0 to help coverity? I dont understand the question > 3. In cases like these it would be important to actually note why this > assert can't be triggered. With a comment like "The ts_from_file option > is not supported by piped input demuxers". its kind of clear from the assert but i added the comment, > 4. I just sent an alternative for this: > https://ffmpeg.org/pipermail/ffmpeg-devel/2024-May/327035.html. I don't > know which one should be preferred or whether the code should be left as-= is. I think if somehow ts_from_file and is_pipe are set. Thats a bug in the code its only the combination of flags and AVOptions that prevents this. I think an assert like in my patch makes the code more robust compared to simply not crashing on an inconsistant state thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The worst form of inequality is to try to make unequal things equal. -- Aristotle --pNqwZkzUt4Yweo7t Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZjvauAAKCRBhHseHBAsP q4wPAJ9kU/GGsJcL4mYnhYhVZGwROh/crwCgmGuXkqd2z12kSQ87GwDew+ixLQc= =cCvF -----END PGP SIGNATURE----- --pNqwZkzUt4Yweo7t-- --===============6641358873715341485== 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". --===============6641358873715341485==--