summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-10-29 14:44:47 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-10-30 00:15:37 +0100
commitd30522e46ca884e9bc74af21711d9537e8118859 (patch)
tree05c48dad57b4bae97e4b1b53d4a76f216deb90ed /xmloff
parentbbfec269bda9906eae66b207987d53bbea969eec (diff)
ofz#3895 Integer-overflow
Change-Id: Ibc90bdad5edf2d382e358dde4a0bfce6e4276584 Reviewed-on: https://gerrit.libreoffice.org/44026 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/shadwhdl.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/xmloff/source/style/shadwhdl.cxx b/xmloff/source/style/shadwhdl.cxx
index 139e60835b90..20d12f7571f4 100644
--- a/xmloff/source/style/shadwhdl.cxx
+++ b/xmloff/source/style/shadwhdl.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/table/ShadowFormat.hpp>
+#include <o3tl/safeint.hxx>
#include <tools/color.hxx>
#include <sax/tools/converter.hxx>
#include <xmloff/xmluconv.hxx>
@@ -98,8 +99,10 @@ bool XMLShadowPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue
if( nX < 0 ) nX *= -1;
if( nY < 0 ) nY *= -1;
- aShadow.ShadowWidth = sal::static_int_cast< sal_Int16 >(
- (nX + nY) >> 1);
+ sal_Int32 nWidth;
+ bRet = !o3tl::checked_add(nX, nY, nWidth);
+ if (bRet)
+ aShadow.ShadowWidth = sal::static_int_cast<sal_Int16>(nWidth >> 1);
}
}
}