[Libreoffice-commits] libmspub.git: src/lib

David Tardon dtardon at redhat.com
Mon Mar 19 09:25:36 UTC 2018


 src/lib/MSPUBCollector.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 4a517815d868b3fa5ab4bf99621177dda8dc3f3b
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Mar 19 10:24:53 2018 +0100

    ofz#7006 tweak to avoid signed int overflow
    
    Change-Id: Ic8d3835c7f70639ec4d0cb566c2cf6eaa543a61e

diff --git a/src/lib/MSPUBCollector.cpp b/src/lib/MSPUBCollector.cpp
index a2efb2c..94266c2 100644
--- a/src/lib/MSPUBCollector.cpp
+++ b/src/lib/MSPUBCollector.cpp
@@ -459,13 +459,13 @@ Coordinate getFudgedCoordinates(Coordinate coord, const std::vector<Line> &lines
   }
   else
   {
-    if (unsigned(fudged.m_xe - fudged.m_xs) > leftFudge)
+    if (int64_t(fudged.m_xe) - fudged.m_xs > leftFudge)
       fudged.m_xs += leftFudge;
-    if (unsigned(fudged.m_xe - fudged.m_xs) > rightFudge)
+    if (int64_t(fudged.m_xe) - fudged.m_xs > rightFudge)
       fudged.m_xe -= rightFudge;
-    if (unsigned(fudged.m_ye - fudged.m_ys) > topFudge)
+    if (int64_t(fudged.m_ye) - fudged.m_ys > topFudge)
       fudged.m_ys += topFudge;
-    if (unsigned(fudged.m_ye - fudged.m_ys) > bottomFudge)
+    if (int64_t(fudged.m_ye) - fudged.m_ys > bottomFudge)
       fudged.m_ye -= bottomFudge;
   }
   return fudged;


More information about the Libreoffice-commits mailing list