From 875a2afea73aaea306fb757dc2533c26686206f6 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 20 Jan 2018 15:30:01 +0100 Subject: ofz#5515 avoid signed integer overflow Change-Id: I80207d028bd5348e4f53b8888f7deec1eb48e6c2 --- src/lib/MSPUBParser.cpp | 4 ++-- 1 file 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; -- cgit v1.2.3