diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-28 16:19:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-29 10:40:06 +0000 |
commit | 1ed46f6cb71ddf274490f2f851ca5566fbfb7ae2 (patch) | |
tree | 8634b13cdf57798e9e22c4b2df92675daf90512c /svtools/source/misc/imap.cxx | |
parent | 683ecd2816400ec5d28675417f394561f4de5a50 (diff) |
coverity#1078539 Division or modulo by zero
Change-Id: Ifbe3cbd8fa93ee828ed95c19893c52b8134d3fd1
Diffstat (limited to 'svtools/source/misc/imap.cxx')
-rw-r--r-- | svtools/source/misc/imap.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 705021afe3fb..647f3e8fbc31 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -383,6 +383,9 @@ void IMapCircleObject::Scale( const Fraction& rFracX, const Fraction& rFracY ) SCALEPOINT( aCenter, rFracX, rFracY ); } + if (!aAverage.GetDenominator()) + throw std::runtime_error("divide by zero"); + nRadius = ( nRadius * aAverage.GetNumerator() ) / aAverage.GetDenominator(); } |