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 93F9D4B1D4 for ; Mon, 1 Jul 2024 20:19:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3563868D836; Mon, 1 Jul 2024 23:19:39 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1C13E68D60B for ; Mon, 1 Jul 2024 23:19:33 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 47F45FF805 for ; Mon, 1 Jul 2024 20:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1719865172; 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=ZyBrDwTYkPjHrNGICMpyhEn2gOjTJIgJbu4+toONJFs=; b=dYGi71lRpO2jX2oofmvO3pUma05CQ5PUTanXEmZI/4h4yEYyG6KNF4gQMCYa730DPpIAqY MQNhqbIzT8L1fdZi5iOHMQscLNAhQJxY+B4n41isH8+WsrfJALE8ZzWQE7SypckHDDYia0 +Bs++xCL9tzUBYaNym9rhbi3FMMhqKlWrvN9jGmnwtnV1durrjneeOPu/YGID6kOrFcoVL q3Qlr7LDVkHFKrW883pFnZJkmSe0zhHr0NVXV4LK/G8z7T6/D9W5cTx9gF6rHjUYJ9r654 MtGvfImDxCj9Hhm/Wxo1u5J2MC7nMOYUkm0XMAgVeWG7b7KjdkkOuwuGj+Hqwg== Date: Mon, 1 Jul 2024 22:19:31 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240701201931.GI4991@pb2> References: <20240701133923.GF4991@pb2> <2e923434-4c36-4921-b728-acdc4dd39233@rothenpieler.org> MIME-Version: 1.0 In-Reply-To: <2e923434-4c36-4921-b728-acdc4dd39233@rothenpieler.org> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [RFC] av_rescale() coverity 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="===============2969161657443585990==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2969161657443585990== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2HnjjwBZJnP787BF" Content-Disposition: inline --2HnjjwBZJnP787BF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 01, 2024 at 08:50:24PM +0200, Timo Rothenpieler wrote: > On 01.07.2024 15:39, Michael Niedermayer wrote: > > Hi all > >=20 > > coverity seems to have started to do a new thing. Namely if theres a > > return statement it assumes it can independant of everything occurr > >=20 > > an example would be av_rescale() which on overflow returns INT64_MIN > >=20 > > also with the right flags av_rescale() will pass INT64_MIN and INT64_MA= X through > > from the input > >=20 > > So coverity since a few days seems to treat every av_rescale() call as = if it returns > > INT64_MIN and INT64_MAX. coverity doesnt care if that return statement = is reachable or > > if the flags even include the execution path. > >=20 > > An example is this: > > AVRational time_base_q =3D AV_TIME_BASE_Q; > > int64_t next_dts =3D av_rescale_q(ds->next_dts, time_base_= q, av_inv_q(ist->framerate)); > > ds->next_dts =3D av_rescale_q(next_dts + 1, av_inv_q(ist->= framerate), time_base_q); > >=20 > > Here coverity as a initial statement claims next_dts is INT64_MAX > > and next_dts + 1 would overflow > >=20 > >=20 > > 8. function_return: Function av_rescale_q(ds->next_dts, time_base_= q, av_inv_q(ist->framerate)) returns 9223372036854775807. > > 9. known_value_assign: next_dts =3D av_rescale_q(ds->next_= dts, time_base_q, av_inv_q(ist->framerate)), its value is now 9223372036854= 775807. > > 331 int64_t next_dts =3D av_rescale_q(ds->next_dts, tim= e_base_q, av_inv_q(ist->framerate)); > >=20 > > CID 1604545: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW) > > 10. overflow_const: Expression next_dts + 1LL, which is equal to -= 9223372036854775808, where next_dts is known to be equal to 922337203685477= 5807, overflows the type that receives it, a signed integer 64 bits wide. > >=20 > >=20 > > another example is this: > >=20 > > #define AV_TIME_BASE 1000000 > > pts =3D av_rescale(ds->dts, 1000000, AV_TIME_BASE); > >=20 > > coverity hallucinates pts as a tainted negative number here nothing say= s anything about > > the input ds->dts (and thats what would matter) > >=20 > > In the past coverity provided a detailed list of steps on how a > > case is reached. One could then check these assumtions and mark things > > as false positive when one assumtion is wrong. (coverity was most of th= e time > > wrong) > >=20 > > Now coverity just hallucinates claims out of the blue without any > > explanation how that can happen. > >=20 > > Iam a bit at a loss how to deal with this and also why exactly this > > new behavior appeared. > >=20 > > Has anyone changed any setting or anything in coverity ? > >=20 > > The number of issues shot up to over 400 on the 22th june > > "194 new defect(s) introduced to FFmpeg/FFmpeg found with Coverity Scan= =2E" >=20 > Do you mean May? > Cause that's when I enabled also giving a Windows-Build to Coverity: > https://github.com/FFmpeg/FFmpeg-Coverity/commit/3116e6960406f01f96d93451= 6216bb3b402122fc >=20 > Before that, only Linux was analyzed. no the 194 appeared in june I did saw some other spike of issues appear month? earlier or so but these = seemed mostly old issues that where detected prior already. and i dont see it in teh numbers coverity mails me Only other spike i can find in the numbers was 11 feb 2024 103 new defect(s) introduced to FFmpeg/FFmpeg found with Coverity Scan. thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates --2HnjjwBZJnP787BF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZoMPUAAKCRBhHseHBAsP q3PaAJ90CCWiWG74lXtIMwvePDdNeVum7ACeLjhnP/ooiU42dqwyC3/+OylWrcM= =Uel5 -----END PGP SIGNATURE----- --2HnjjwBZJnP787BF-- --===============2969161657443585990== 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". --===============2969161657443585990==--