summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2018-03-07 09:56:06 +0100
committerDavid Tardon <dtardon@redhat.com>2018-03-07 09:56:06 +0100
commitb16a16cdb63c811dc860417bc8db9b012b7dd19f (patch)
tree2595802cb77de329b966a9fe0c6b5e79b40c3e1c
parent8a13e4b2677adb99cd46d02c0ef6d7d1aadade34 (diff)
ofz#6777 fix division by zero
Change-Id: I62bd09260b448a585ef5864181b2c6bceb5b361c
-rw-r--r--src/lib/MSPUBCollector.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/MSPUBCollector.cpp b/src/lib/MSPUBCollector.cpp
index 405470e..c050930 100644
--- a/src/lib/MSPUBCollector.cpp
+++ b/src/lib/MSPUBCollector.cpp
@@ -1352,7 +1352,7 @@ double MSPUBCollector::getSpecialValue(const ShapeInfo &info, const CustomShape
if (arg == ASPECT_RATIO)
{
const Coordinate coord = info.m_coordinates.get_value_or(Coordinate());
- return (double)coord.getWidthIn() / coord.getHeightIn();
+ return coord.getHeightIn() != 0 ? double(coord.getWidthIn()) / coord.getHeightIn() : 0;
}
if (arg & OTHER_CALC_VAL)
{