summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}
}