diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-28 09:02:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-28 16:17:17 +0200 |
commit | bc7c37f2f67ace27196a46c62c2d568501e9f796 (patch) | |
tree | 7bc92ee0c553f72574f8555039c1163927e900d7 /tools | |
parent | d6605cc5f4e2b2cc52e2f2c9645a09171529d9d0 (diff) |
ofz#33769 Integer-overflow
Change-Id: I067db0452650cf3e8bc887abac74c4ff796d4ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114768
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/poly.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index e482528b9ab1..05d35f7d1385 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -227,14 +227,14 @@ ImplPolygon::ImplPolygon( const Point& rCenter, tools::Long nRadX, tools::Long n ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, const Point& rEnd, PolyStyle eStyle ) { - const tools::Long nWidth = rBound.GetWidth(); - const tools::Long nHeight = rBound.GetHeight(); + const auto nWidth = rBound.GetWidth(); + const auto nHeight = rBound.GetHeight(); if( ( nWidth > 1 ) && ( nHeight > 1 ) ) { const Point aCenter( rBound.Center() ); - const tools::Long nRadX = aCenter.X() - rBound.Left(); - const tools::Long nRadY = aCenter.Y() - rBound.Top(); + const auto nRadX = o3tl::saturating_sub(aCenter.X(), rBound.Left()); + const auto nRadY = o3tl::saturating_sub(aCenter.Y(), rBound.Top()); sal_uInt16 nPoints; tools::Long nRadXY; |