[Libreoffice-commits] core.git: filter/source
Caolán McNamara
caolanm at redhat.com
Wed Apr 4 22:24:15 UTC 2018
filter/source/graphicfilter/icgm/class4.cxx | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
New commits:
commit 40e23abecde809a6e7229fae912a392a9552c1fb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 4 17:15:45 2018 +0100
ofz#7364 Integer overflow
Change-Id: I1b0f5e4e951dae396fefc6ec55f7f04a8503ea89
Reviewed-on: https://gerrit.libreoffice.org/52402
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx
index c2c0e95910f1..4db70a8acbc5 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -408,8 +408,8 @@ void CGM::ImplDoClass4()
if ( mbFigure )
{
- tools::Rectangle aBoundingBox( Point( static_cast<long>( aCenterPoint.X - fRadius ), long( aCenterPoint.Y - fRadius ) ),
- Size( static_cast< long >( 2 * fRadius ), static_cast<long>( 2 * fRadius) ) );
+ tools::Rectangle aBoundingBox(aCenterPoint.X - fRadius, aCenterPoint.Y - fRadius);
+ aBoundingBox.SaturatingSetSize(Size(2 * fRadius, 2 * fRadius));
tools::Polygon aPolygon( aBoundingBox, Point( static_cast<long>(aStartingPoint.X), static_cast<long>(aStartingPoint.Y) ) ,Point( static_cast<long>(aEndingPoint.X), static_cast<long>(aEndingPoint.Y) ), PolyStyle::Arc );
if ( nSwitch )
mpOutAct->RegPolyLine( aPolygon, true );
@@ -526,9 +526,8 @@ void CGM::ImplDoClass4()
if ( mbFigure )
{
- tools::Rectangle aBoundingBox(
- Point( static_cast<long>( aCenter.X - aRadius.X ), long( aCenter.Y - aRadius.X ) ),
- Size( static_cast< long >( 2 * aRadius.X ), static_cast<long>( 2 * aRadius.X ) ) );
+ tools::Rectangle aBoundingBox(aCenter.X - aRadius.X, aCenter.Y - aRadius.X);
+ aBoundingBox.SaturatingSetSize(Size(2 * aRadius.X, 2 * aRadius.X));
tools::Polygon aPolygon( aBoundingBox,
Point( static_cast<long>(vector[ 0 ]), static_cast<long>(vector[ 1 ]) ),
Point( static_cast<long>(vector[ 2 ]), static_cast<long>(vector[ 3 ]) ), PolyStyle::Arc );
More information about the Libreoffice-commits
mailing list