summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2018-03-19 10:24:53 +0100
committerDavid Tardon <dtardon@redhat.com>2018-03-19 10:24:53 +0100
commit4a517815d868b3fa5ab4bf99621177dda8dc3f3b (patch)
tree8f95191b81aa3c1f7f55b378d13587f67e46396c
parent28c545e7d04d58af998bcf4af5d1bb326d29836c (diff)
ofz#7006 tweak to avoid signed int overflow
Change-Id: Ic8d3835c7f70639ec4d0cb566c2cf6eaa543a61e
-rw-r--r--src/lib/MSPUBCollector.cpp8
1 files changed, 4 insertions, 4 deletions
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;