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

New commits:
commit ade76371f03c793335ebab3b9b7a6bc64f6c6e04
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Jul 20 14:56:55 2024 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Jul 23 08:57:47 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]>
    (cherry picked from commit 0eb68857daef5b0fcda8bfe501d3f0a683590a1f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170869
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 5c8ba5fb64ad..db41c94769c9 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