svx/source/customshapes/EnhancedCustomShape2d.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 0eb68857daef5b0fcda8bfe501d3f0a683590a1f
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Jul 20 14:56:55 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat Jul 20 17:53:46 2024 +0200

    ofz#70412 Integer-overflow
    
    Change-Id: I3c12382110fa9a22474adba12c6e5772e45c65e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170796
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index bc640da6af2d..f42d90cfd3fb 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -559,8 +559,12 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const 
SdrCustomShapeGeometryIt
     {
         m_nCoordLeft    = aViewBox.X;
         m_nCoordTop     = aViewBox.Y;
-        m_nCoordWidthG  = std::abs( aViewBox.Width );
-        m_nCoordHeightG = std::abs( aViewBox.Height);
+        m_nCoordWidthG  = aViewBox.Width;
+        if (m_nCoordWidthG < 0)
+            m_nCoordWidthG = o3tl::saturating_toggle_sign(m_nCoordWidthG);
+        m_nCoordHeightG = aViewBox.Height;
+        if (m_nCoordHeightG < 0)
+            m_nCoordHeightG = o3tl::saturating_toggle_sign(m_nCoordHeightG);
     }
     static constexpr OUString sPath( u"Path"_ustr );
     static constexpr OUStringLiteral sCoordinates( u"Coordinates" );

Reply via email to