From 2f752afbb075c4caa67697d9e8b249ae29824bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 14 Apr 2021 15:31:04 +0100 Subject: [PATCH] ofz#33235 Integer-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7a717a5bfdd58f22de3dcd61fe4aad67d1463a42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114099 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- tools/source/generic/poly.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); }