summaryrefslogtreecommitdiff
path: root/svx/source/engine3d/obj3d.cxx
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-11-04 15:38:20 +0100
committerDavid Tardon <dtardon@redhat.com>2014-11-04 19:52:47 +0100
commit5978dd0d091fbe26eb3bb0612b70b49c376738d5 (patch)
tree6ef5e0f8780b45e16dec94e02b6d5ccf4d00cf88 /svx/source/engine3d/obj3d.cxx
parent5f305a053291c8382d791297af95c8523fd98638 (diff)
coverity#735629 coverity#735630 division by zero
Change-Id: Ic243df16a59bcb9a90a655a70d2e21cae54ef930
Diffstat (limited to 'svx/source/engine3d/obj3d.cxx')
-rw-r--r--svx/source/engine3d/obj3d.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 9e8615306a91..eee59ad5bbec 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <o3tl/numeric.hxx>
#include "svx/svdstr.hrc"
#include "svdglob.hxx"
@@ -397,6 +398,9 @@ void E3dObject::NbcMove(const Size& rSize)
basegfx::B3DRange aEyeVol(pScene->GetBoundVolume());
aEyeVol.transform(aViewInfo3D.getOrientation());
+ if ((aRect.GetWidth() == 0) || (aRect.GetHeight() == 0))
+ throw o3tl::divide_by_zero();
+
// build relative movement vector in eye coordinates
basegfx::B3DPoint aMove(
(double)rSize.Width() * aEyeVol.getWidth() / (double)aRect.GetWidth(),