Kaydet (Commit) 312244a5 authored tarafından David Tardon's avatar David Tardon

coverity#735658 coverity#735659 division by zero

Change-Id: I2e73cd105af7aa9d926659d3275bf10de9993d62
üst c11c8f0a
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
#include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/languagetag.hxx>
#include <o3tl/numeric.hxx>
#include <osl/file.hxx> #include <osl/file.hxx>
#include <osl/thread.h> #include <osl/thread.h>
#include <rtl/crc.h> #include <rtl/crc.h>
...@@ -8971,6 +8972,9 @@ static double calcAngle( const Rectangle& rRect, const Point& rPoint ) ...@@ -8971,6 +8972,9 @@ static double calcAngle( const Rectangle& rRect, const Point& rPoint )
double fX = (double)aPoint.X(); double fX = (double)aPoint.X();
double fY = (double)-aPoint.Y(); double fY = (double)-aPoint.Y();
if ((rRect.GetHeight() == 0) || (rRect.GetWidth() == 0))
throw o3tl::divide_by_zero();
if( rRect.GetWidth() > rRect.GetHeight() ) if( rRect.GetWidth() > rRect.GetHeight() )
fY = fY*((double)rRect.GetWidth()/(double)rRect.GetHeight()); fY = fY*((double)rRect.GetWidth()/(double)rRect.GetHeight());
else if( rRect.GetHeight() > rRect.GetWidth() ) else if( rRect.GetHeight() > rRect.GetWidth() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment