diff options
author | David Tardon <dtardon@redhat.com> | 2018-01-20 15:30:01 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2018-01-20 15:30:01 +0100 |
commit | 875a2afea73aaea306fb757dc2533c26686206f6 (patch) | |
tree | 676de8365e5d107d53a77dbacf887fa4d8dd2744 | |
parent | 5cd502a195c713c1d64efcaa5ebc82cd422a5f5e (diff) |
ofz#5515 avoid signed integer overflow
Change-Id: I80207d028bd5348e4f53b8888f7deec1eb48e6c2
-rw-r--r-- | src/lib/MSPUBParser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp index 05e0e11..d838d5d 100644 --- a/src/lib/MSPUBParser.cpp +++ b/src/lib/MSPUBParser.cpp @@ -1957,8 +1957,8 @@ void MSPUBParser::parseEscherShape(librevenge::RVNGInputStream *input, const Esc int coordSystemHeight = thisParentCoordinateSystem.m_ye - thisParentCoordinateSystem.m_ys; if (coordSystemHeight == 0) coordSystemHeight = 1; - int groupWidth = parentGroupAbsoluteCoord.m_xe - parentGroupAbsoluteCoord.m_xs; - int groupHeight = parentGroupAbsoluteCoord.m_ye - parentGroupAbsoluteCoord.m_ys; + int groupWidth = int64_t(parentGroupAbsoluteCoord.m_xe) - parentGroupAbsoluteCoord.m_xs; + int groupHeight = int64_t(parentGroupAbsoluteCoord.m_ye) - parentGroupAbsoluteCoord.m_ys; double widthScale = (double)groupWidth / coordSystemWidth; double heightScale = (double)groupHeight / coordSystemHeight; int xs = (readU32(input) - thisParentCoordinateSystem.m_xs) * widthScale + parentGroupAbsoluteCoord.m_xs; |