diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-27 20:42:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-28 13:10:34 +0200 |
commit | 550e50c529f8be00320cfd7ab1c305d9e6912dea (patch) | |
tree | 8fbb8a0c7b38b4f99246d073458e181f5b8aac12 /tools | |
parent | b81ff51a8ccac942effdd309f014591604376ecc (diff) |
ofz#69290 Integer-overflow
Change-Id: I20b49bf5e3a507979332cd854205f290a3b3971c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168118
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/poly.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 81419f7e70c3..b6b00bc2ca34 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -179,8 +179,7 @@ ImplPolygon::ImplPolygon( const Point& rCenter, tools::Long nRadX, tools::Long n if (!bOverflow) { nPoints = std::clamp( - ( M_PI * ( 1.5 * ( nRadX + nRadY ) - - sqrt( static_cast<double>(std::abs(nRadXY)) ) ) ), + ( M_PI * ( 1.5 * ( nRadX + nRadY ) - sqrt( std::fabs(nRadXY) ) ) ), 32.0, 256.0 ); } else @@ -245,8 +244,7 @@ ImplPolygon::ImplPolygon(const tools::Rectangle& rBound, const Point& rStart, co if (!bOverflow) { nPoints = std::clamp( - ( M_PI * ( 1.5 * ( nRadX + nRadY ) - - sqrt( static_cast<double>(std::abs(nRadXY)) ) ) ), + ( M_PI * ( 1.5 * ( nRadX + nRadY ) - sqrt( std::fabs(nRadXY) ) ) ), 32.0, 256.0 ); } else |