[Libreoffice-commits] core.git: xmloff/source
Caolán McNamara
caolanm at redhat.com
Sun Nov 5 16:55:52 UTC 2017
xmloff/source/style/shadwhdl.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit b97d210bce5f05c23330b7a6fb0602f8f74da5a0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Nov 4 21:01:39 2017 +0000
ofz#4057 Integer-overflow
Change-Id: I6a7ef3ca4c26ce4965deeea27ae47a03169bcf12
Reviewed-on: https://gerrit.libreoffice.org/44320
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/xmloff/source/style/shadwhdl.cxx b/xmloff/source/style/shadwhdl.cxx
index 20d12f7571f4..0e14ed87fbd1 100644
--- a/xmloff/source/style/shadwhdl.cxx
+++ b/xmloff/source/style/shadwhdl.cxx
@@ -96,8 +96,10 @@ bool XMLShadowPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue
aShadow.Location = table::ShadowLocation_BOTTOM_RIGHT;
}
- if( nX < 0 ) nX *= -1;
- if( nY < 0 ) nY *= -1;
+ if (nX < 0)
+ nX = o3tl::saturating_toggle_sign(nX);
+ if (nY < 0)
+ nY = o3tl::saturating_toggle_sign(nY);
sal_Int32 nWidth;
bRet = !o3tl::checked_add(nX, nY, nWidth);
More information about the Libreoffice-commits
mailing list