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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 23 15:49:25 UTC 2021


 tools/source/generic/poly.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 623b633f1145466e8d60fff3255f476e6001297b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jun 23 14:04:39 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 23 17:48:37 2021 +0200

    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 at redhat.com>

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;


More information about the Libreoffice-commits mailing list