summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-10 11:35:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-10 21:02:51 +0100
commit31dcf60fc8e6bd2f49728e157319af3204f7f1a1 (patch)
treed4bba4c544252d98bca306929311a952d355832b /oox
parentcd5a4971bb84bb588a990a252a84ed799fe1ebeb (diff)
ofz#4576 Integer-overflow
Change-Id: I8042170ca2c3e66887374a94aa7d335e4445be69 Reviewed-on: https://gerrit.libreoffice.org/46182 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')
-rw-r--r--oox/source/drawingml/drawingmltypes.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx
index e8ea37dc9cab..cda9c1c61817 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/drawing/Hatch.hpp>
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#include <sax/tools/converter.hxx>
#include <oox/token/tokens.hxx>
@@ -40,7 +41,8 @@ namespace drawingml {
/** converts EMUs into 1/100th mmm */
sal_Int32 GetCoordinate( sal_Int32 nValue )
{
- return (nValue + 180) / 360;
+ nValue = o3tl::saturating_add<sal_Int32>(nValue, 180);
+ return nValue / 360;
}
/** converts an emu string into 1/100th mmm */