summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-23 14:04:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-06-23 17:48:37 +0200
commit623b633f1145466e8d60fff3255f476e6001297b (patch)
treebafaa3e029c3eaed6c81613bf6eac4274e8a12c4 /tools
parente33742b64ab325dbc596b4fbdaf229ff91e11e93 (diff)
ofz#35504 Integer-overflow
Change-Id: If8c460a4890ad23c2656c3b677b6c2ad8d46fb2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117734 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/poly.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 9d5f63fc65e9..1f60337cffa1 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -236,8 +236,8 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c
// tdf#142268 Get Top Left corner of rectangle (the rectangle is not always correctly created)
const auto aBoundLeft = rBound.Left() < aCenter.X() ? rBound.Left() : rBound.Right();
const auto aBoundTop = rBound.Top() < aCenter.Y() ? rBound.Top() : rBound.Bottom();
- const auto nRadX = aCenter.X() - aBoundLeft;
- const auto nRadY = aCenter.Y() - aBoundTop;
+ const auto nRadX = o3tl::saturating_sub(aCenter.X(), aBoundLeft);
+ const auto nRadY = o3tl::saturating_sub(aCenter.Y(), aBoundTop);
sal_uInt16 nPoints;
tools::Long nRadXY;