vcl/source/gdi/regionband.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c38d17b62c3ec206ccf484d701ff95cd037c6a4e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Sep 29 13:08:49 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Sep 29 16:04:32 2022 +0200

    ofz#51859 Integer-overflow
    
    Change-Id: I985164aad4f0133c258d6bdb8a4f38a75c3f7edf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140736
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/gdi/regionband.cxx b/vcl/source/gdi/regionband.cxx
index e772d5b27c5b..5a8e3676e57e 100644
--- a/vcl/source/gdi/regionband.cxx
+++ b/vcl/source/gdi/regionband.cxx
@@ -23,6 +23,7 @@
 
 #include <tools/stream.hxx>
 #include <regionband.hxx>
+#include <o3tl/safeint.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
 
@@ -676,8 +677,8 @@ void RegionBand::Move(tools::Long nHorzMove, tools::Long 
nVertMove)
         // process the vertical move
         if(nVertMove)
         {
-            pBand->mnYTop = pBand->mnYTop + nVertMove;
-            pBand->mnYBottom = pBand->mnYBottom + nVertMove;
+            pBand->mnYTop = o3tl::saturating_add(pBand->mnYTop, nVertMove);
+            pBand->mnYBottom = o3tl::saturating_add(pBand->mnYBottom, 
nVertMove);
         }
 
         // process the horizontal move

Reply via email to