diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-04 17:15:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-05 00:23:52 +0200 |
commit | 40e23abecde809a6e7229fae912a392a9552c1fb (patch) | |
tree | e8b16e3e3b3caf62aa7d6977ec8daff26fe9c52d /filter | |
parent | Updated core (diff) | |
download | core-40e23abecde809a6e7229fae912a392a9552c1fb.tar.gz core-40e23abecde809a6e7229fae912a392a9552c1fb.zip |
ofz#7364 Integer overflow
Change-Id: I1b0f5e4e951dae396fefc6ec55f7f04a8503ea89
Reviewed-on: https://gerrit.libreoffice.org/52402
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/icgm/class4.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
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 ); |