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 F36194B3DD for ; Fri, 5 Jul 2024 12:50:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A8CB368DB45; Fri, 5 Jul 2024 15:50:49 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2A65668DB38 for ; Fri, 5 Jul 2024 15:50:43 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 787621C0003 for ; Fri, 5 Jul 2024 12:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720183842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=d7cWKUi1I4/KJyPv9n6tuHWROWbI3eEorxbew90xLLM=; b=GY5/y5CSu4CD39Py52EqIHiVTxcMO+GhWUV4zaKj+gbRz3Wem5dmBb+Gts86PKcO0GRFAA pNIK5hFiSaYxFNR6RmCxofs+Lf7Iyng4nGKz2uUr8V5+wSq9fdFs0E4dLI3Dp8pfKS2eLh RurbLpEL2sHwi6rvI9sEUyzDUQBkgvWy7ZidlT9mGng1YbwA6cLzh7B64qsnsWMnXw/VJg Ds7OU3jtTIXujFZclBFdMQeD30e8j5bEw+HgYNzS5Ear1BV1BYIy/FvEtEBr49cB1rWjZP je3x/N2qys+B/rMi3hhMx3k327KWK4q1vXKePSLEIJES5VPg7gargX/N2oYcxA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 5 Jul 2024 14:50:41 +0200 Message-ID: <20240705125041.1967554-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH] tools/coverity: Phase 1 study of anti-halicogenic for coverity av_rescale() 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Michael Niedermayer --- tools/coverity.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/coverity.c b/tools/coverity.c index 19a132a9767..541e108238d 100644 --- a/tools/coverity.c +++ b/tools/coverity.c @@ -31,6 +31,17 @@ #define NULL (void *)0 +typedef long long int64_t; + +enum AVRounding { + AV_ROUND_ZERO = 0, + AV_ROUND_INF = 1, + AV_ROUND_DOWN = 2, + AV_ROUND_UP = 3, + AV_ROUND_NEAR_INF = 5, + AV_ROUND_PASS_MINMAX = 8192, +}; + // Based on https://scan.coverity.com/models void *av_malloc(size_t size) { int has_memory; @@ -77,3 +88,10 @@ void *av_free(void *ptr) { __coverity_mark_as_afm_freed__(ptr, "av_free"); } + +int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd) { + __coverity_negative_sink__(b); + __coverity_negative_sink__(c); + + return (double)a * (double)b / (double)c; +} -- 2.45.2 _______________________________________________ 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".