diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-14 14:19:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-14 18:22:54 +0200 |
commit | 9bb6ed114c1b23ecde1df02d954a3bb1abb17e49 (patch) | |
tree | b55ade4b96772048549f17af5c6af5f201ccb301 /oox/source/drawingml | |
parent | 21e84c0935926e6c2a0bf772d41a4c41df70fd7a (diff) |
ofz#7624 Integer-overflow
Change-Id: Ie7a5ff4d6477bca27b83179559664e751817a608
Reviewed-on: https://gerrit.libreoffice.org/52870
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 'oox/source/drawingml')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 9f92e7e7eecd..3aac4273fc4c 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -33,6 +33,7 @@ #include <oox/drawingml/chart/chartconverter.hxx> #include <drawingml/chart/chartspacefragment.hxx> #include <drawingml/chart/chartspacemodel.hxx> +#include <o3tl/safeint.hxx> #include <oox/ppt/pptimport.hxx> #include <oox/vml/vmldrawing.hxx> #include <oox/vml/vmlshape.hxx> @@ -431,12 +432,12 @@ Reference< XShape > const & Shape::createAndInsert( maSize.Width = 0; for (auto const& elem : mpTablePropertiesPtr->getTableGrid()) { - maSize.Width += elem; + maSize.Width = o3tl::saturating_add(maSize.Width, static_cast<sal_Int32>(elem)); } maSize.Height = 0; for (auto const& elem : mpTablePropertiesPtr->getTableRows()) { - maSize.Height += elem.getHeight(); + maSize.Height = o3tl::saturating_add(maSize.Height, elem.getHeight()); } } |