summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-27 19:08:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-06-28 09:53:10 +0200
commit228cb26a6a1afe668dd17471bedf0ab52f133d5a (patch)
tree9d2a5ad47542f2afdb763cce6490356d5c5c2448
parent3262fc5ef3bde5b158909d11ccb008161ea95519 (diff)
ofz#35504 Integer-overflow
Change-Id: I7a462b821f286411d759b5259461fcdbf1741859 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117955 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--tools/source/generic/poly.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 1f60337cffa1..2575d262a68a 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -255,7 +255,7 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c
}
- if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 )
+ if (nRadX > 32 && nRadY > 32 && o3tl::saturating_add(nRadX, nRadY) < 8192)
nPoints >>= 1;
// compute threshold