summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-04 10:00:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-04 20:44:53 +0000
commitc61b2066660fb0130f0b0f9f51b48e3799625b83 (patch)
tree37242a987c8765237b5dbd163c1010b8d3ff5bf3 /svx
parentf075a3ad08f7d5b53790076d1965818e57628afa (diff)
coverity#735635 Division or modulo by float zero
and coverity#735636 Division or modulo by float zero Change-Id: Ib9c93ea843f63d38bdb8b0e5107f48afc2bdec52
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svddrgmt.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 920df9fda7a2..3011caa9b4bc 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -21,6 +21,7 @@
#include <math.h>
#include <tools/bigint.hxx>
+#include <o3tl/numeric.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include "svx/xattr.hxx"
@@ -3851,6 +3852,9 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
basegfx::fround(aRangeNewNoShearNoRotate.getMaxY()));
// continue with the old original stuff
+ if (!aOldRect.GetWidth() || !aOldRect.GetHeight())
+ throw o3tl::divide_by_zero();
+
double fScaleX = ( aGraphicSize.Width() - rOldCrop.GetLeft() - rOldCrop.GetRight() ) / (double)aOldRect.GetWidth();
double fScaleY = ( aGraphicSize.Height() - rOldCrop.GetTop() - rOldCrop.GetBottom() ) / (double)aOldRect.GetHeight();