From patchwork Wed Oct 20 18:24:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 31177 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp1767962ioa; Wed, 20 Oct 2021 11:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc18vdvRmuCNLeFOKD9gv0MvgUVCgVxhy6oYymPX/5zEiqVMzc8qck5De7Ig9nXtRbLIPg X-Received: by 2002:a17:906:f8d0:: with SMTP id lh16mr1046297ejb.367.1634754332749; Wed, 20 Oct 2021 11:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634754332; cv=none; d=google.com; s=arc-20160816; b=OAPdS7wBlaiBNbhEXOQxw1Dpq5CBdWwgOut34Y4ywRTrysha5yr8MRMsbxezFYjUS+ DP6D/f/gCYjszo/WhFgNl6yQ3ylG48DlVwbFZtsc8v1LBI5L+XW3w7rjt+j0PVMmB5It 5Rn7/Esw660y8EiBQbRbvraLRpujeFbJ7ZpCk43MnVAboSk9MZqAs4PAgDLsb0+wTuLj 6PknMy6aLgBXriesndjKwn5JI8CRMZIhNBnYYC6NrBhVhjA140iFuyQdAsZZAJOnpCjq eH4kZRPG1kRqR5c68QNnKsAimlDgjlrFeo5DBM3c2IpqUFhk0ngV4P6M9eJFDHMRKVt2 oRFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=DPdg9suvqASJqRIjlgUsyW7W4dgCgbDyTyyLICwh/rg=; b=twDOq0Ju+DxbnCDKbcz9DuhqAqB08fEgmIFoWUm2lM19p0oaWZH9Db3kMy8BepsIwY T7PD1Qg/3PzZPPcBXRaKEmJQwciCQjxxNOkKLuxw+Oq2sVrfWziePgvLrk8ljthcTeoR +up8m5e38tmUcKLGKRvJ0G73EohTWdDsIdeJvsWoMZkFegAVags+xjQfs8i6u1RJlm5D FAvPG3/ReEJa/bKiAnrmc/QL08ZLnlcasabdWOSXBbDuJOAu/mjP0iwnazTH6dR38kpU R7vsm4/8XQc5yLGG2UFQ+PunaFYmkJjKfPz0y3tnwF3dsg9fBewsw/NfU9KU4buAeaDo p20g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hb14si4896569ejc.540.2021.10.20.11.25.31; Wed, 20 Oct 2021 11:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B666C68A92E; Wed, 20 Oct 2021 21:25:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-1.mx.upcmail.net (vie01a-dmta-pe02-1.mx.upcmail.net [62.179.121.157]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CFA3468818E for ; Wed, 20 Oct 2021 21:25:20 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1mdGHA-00A500-05 for ffmpeg-devel@ffmpeg.org; Wed, 20 Oct 2021 20:25:20 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id dGGCmiXWLSgGFdGGCmZlcq; Wed, 20 Oct 2021 20:24:20 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=f8Q2+96M c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=rOXdEEcDF2QzTOl3zEwA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 20 Oct 2021 20:24:20 +0200 Message-Id: <20211020182420.3322-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfEPnRc1+EJRyvfQwIxwSESLEaaXWMlvW5O6SsjkL9WMEtYeiMwuLrSb+iQOrtQ7GR0Ri4jVuep+rA/gS85wJBuLbvefWuShiS0ouOp4Hd2FNyBkiaLYm ndAPpZrrNDG/Dzqz+teJZ7Jw32pB6neAqPiFEr/jYLbkEy34dRaI+Nuv Subject: [FFmpeg-devel] [PATCH] avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UYK7LrQPE1rQ Signed-off-by: Michael Niedermayer --- libavutil/mathematics.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h index 54901800ba6..64d4137a602 100644 --- a/libavutil/mathematics.h +++ b/libavutil/mathematics.h @@ -134,6 +134,7 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const; * * The operation is mathematically equivalent to `a * b / c`, but writing that * directly can overflow, and does not support different rounding methods. + * If the result is not representable then INT64_MIN is returned. * * @see av_rescale(), av_rescale_q(), av_rescale_q_rnd() */