From f50e94a36bf21f9f1cef52be980a6bf92faf4f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 23 Jan 2018 15:06:28 +0000 Subject: [PATCH] ofz#5621 Integer-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I98f93101dc287b2ef285f3d9547d44dd06d2fe01 Reviewed-on: https://gerrit.libreoffice.org/48429 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- xmloff/source/draw/ximpshap.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 02f1b2ec8108..5b6523a6ea5a 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -1083,9 +1083,9 @@ void SdXMLLineShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib pOuterSequence->realloc(2); awt::Point* pInnerSequence = pOuterSequence->getArray(); - *pInnerSequence = awt::Point( mnX1 - aTopLeft.X, mnY1 - aTopLeft.Y); + *pInnerSequence = awt::Point(o3tl::saturating_add(mnX1, -aTopLeft.X), o3tl::saturating_add(mnY1, -aTopLeft.Y)); pInnerSequence++; - *pInnerSequence = awt::Point( mnX2 - aTopLeft.X, mnY2 - aTopLeft.Y); + *pInnerSequence = awt::Point(o3tl::saturating_add(mnX2, -aTopLeft.X), o3tl::saturating_add(mnY2, -aTopLeft.Y)); xPropSet->setPropertyValue("Geometry", Any(aPolyPoly)); }