diff options
author | David Tardon <dtardon@redhat.com> | 2014-11-04 15:40:58 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-11-04 19:52:47 +0100 |
commit | 6718e5b1df2623b0a5e6c6f94ba891d5d55ad805 (patch) | |
tree | b02931a8d0b4704c7108e5cd404210227aafdea6 /svx | |
parent | 5978dd0d091fbe26eb3bb0612b70b49c376738d5 (diff) |
coverity#735631 division by zero
Change-Id: I3082395b89c0ecc2ac754cf845ea7892ffea0a9b
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/engine3d/viewpt3d2.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/engine3d/viewpt3d2.cxx b/svx/source/engine3d/viewpt3d2.cxx index 9deafdf9fb1f..02b798821993 100644 --- a/svx/source/engine3d/viewpt3d2.cxx +++ b/svx/source/engine3d/viewpt3d2.cxx @@ -19,6 +19,7 @@ #include <svx/viewpt3d.hxx> #include <basegfx/range/b3drange.hxx> +#include <o3tl/numeric.hxx> Viewport3D::Viewport3D() : aVRP(0, 0, 5), @@ -162,6 +163,8 @@ void Viewport3D::SetDeviceWindow(const Rectangle& rRect) break; case AS_HOLD_Y: + if (nNewH == 0) + throw o3tl::divide_by_zero(); // Adapt view width to view height fRatio = (double) nNewW / nNewH; fTmp = aViewWin.W; |