summaryrefslogtreecommitdiffstats
path: root/filter/source/msfilter/msdffimp.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-03 16:52:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-03 21:48:23 +0100
commit102c0cc175602d1bca654813cc184f52e80f94cb (patch)
tree1e6857b935ff6744433a1655b2950d9f7cc60b2b /filter/source/msfilter/msdffimp.cxx
parentUse for-range loops in chart2 (part1) (diff)
downloadcore-102c0cc175602d1bca654813cc184f52e80f94cb.tar.gz
core-102c0cc175602d1bca654813cc184f52e80f94cb.zip
ofz#6702 Integer-overflow
Change-Id: I68edb7b6f508eac3102ff1584c14675e5e167ff4 Reviewed-on: https://gerrit.libreoffice.org/50682 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/source/msfilter/msdffimp.cxx')
-rw-r--r--filter/source/msfilter/msdffimp.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 89404f1a986a..76f67d63f3b6 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1576,8 +1576,8 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
const OUString sViewBox( "ViewBox" );
aViewBox.X = GetPropertyValue( DFF_Prop_geoLeft, 0 );
aViewBox.Y = GetPropertyValue( DFF_Prop_geoTop, 0 );
- aViewBox.Width = nCoordWidth = static_cast<sal_Int32>(GetPropertyValue( DFF_Prop_geoRight, 21600 )) - aViewBox.X;
- aViewBox.Height = nCoordHeight = static_cast<sal_Int32>(GetPropertyValue( DFF_Prop_geoBottom, 21600 )) - aViewBox.Y;
+ aViewBox.Width = nCoordWidth = o3tl::saturating_sub<sal_Int32>(GetPropertyValue(DFF_Prop_geoRight, 21600), aViewBox.X);
+ aViewBox.Height = nCoordHeight = o3tl::saturating_sub<sal_Int32>(GetPropertyValue(DFF_Prop_geoBottom, 21600), aViewBox.Y);
aProp.Name = sViewBox;
aProp.Value <<= aViewBox;
aPropVec.push_back( aProp );