[Libreoffice-commits] core.git: emfio/source

Caolán McNamara caolanm at redhat.com
Sun Oct 29 13:08:06 UTC 2017


 emfio/source/reader/emfreader.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fc4f2f1b0f8c286e9ae259c44fb249261a8ac47f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Oct 28 16:16:51 2017 +0100

    ofz#3868 Integer-overflow
    
    Change-Id: Id5de484e365567487cdeaf73f9fa88ef5a735e3e
    Reviewed-on: https://gerrit.libreoffice.org/44011
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 4ffecf5d8e03..4205d8dee225 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1921,9 +1921,9 @@ namespace emfio
 
     tools::Rectangle EmfReader::ReadRectangle( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 )
     {
-        Point aTL ( Point( x1, y1 ) );
-        Point aBR( Point( --x2, --y2 ) );
-        return tools::Rectangle( aTL, aBR );
+        Point aTL(x1, y1);
+        Point aBR(o3tl::saturating_add<sal_Int32>(x2, -1), o3tl::saturating_add<sal_Int32>(y2, -1));
+        return tools::Rectangle(aTL, aBR);
     }
 }
 


More information about the Libreoffice-commits mailing list