summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-11-04 15:46:13 +0100
committerDavid Tardon <dtardon@redhat.com>2014-11-04 19:52:48 +0100
commit312244a590cba007ba70caf75c4d8d2ab6a385a1 (patch)
tree5fe79abb5bbffe35538b63cac19df9cc3881549c /vcl/source/gdi
parentc11c8f0a9bd2571c63b9a289b2d5de219de68a6b (diff)
coverity#735658 coverity#735659 division by zero
Change-Id: I2e73cd105af7aa9d926659d3275bf10de9993d62
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 40e5b7bb677d..04b4cea993d0 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -37,6 +37,7 @@
#include <comphelper/string.hxx>
#include <cppuhelper/implbase1.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <o3tl/numeric.hxx>
#include <osl/file.hxx>
#include <osl/thread.h>
#include <rtl/crc.h>
@@ -8971,6 +8972,9 @@ static double calcAngle( const Rectangle& rRect, const Point& rPoint )
double fX = (double)aPoint.X();
double fY = (double)-aPoint.Y();
+ if ((rRect.GetHeight() == 0) || (rRect.GetWidth() == 0))
+ throw o3tl::divide_by_zero();
+
if( rRect.GetWidth() > rRect.GetHeight() )
fY = fY*((double)rRect.GetWidth()/(double)rRect.GetHeight());
else if( rRect.GetHeight() > rRect.GetWidth() )