[Libreoffice-commits] core.git: tools/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 14 16:33:57 UTC 2021


 tools/source/generic/poly.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2f752afbb075c4caa67697d9e8b249ae29824bbe
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Apr 14 15:31:04 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Apr 14 18:33:16 2021 +0200

    ofz#33235 Integer-overflow
    
    Change-Id: I7a717a5bfdd58f22de3dcd61fe4aad67d1463a42
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114099
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 9d06055150b4..e482528b9ab1 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -57,7 +57,7 @@
 static double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR )
 {
     const tools::Long nDX = rPt.X() - rCenter.X();
-    double fAngle = atan2( -rPt.Y() + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) );
+    double fAngle = atan2( o3tl::saturating_toggle_sign(rPt.Y()) + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) );
 
     return atan2(fWR*sin(fAngle), fHR*cos(fAngle));
 }


More information about the Libreoffice-commits mailing list