[Libreoffice-commits] core.git: Branch 'aoo/trunk' - vcl/source

Pedro Giffuni pfg at apache.org
Tue Dec 1 16:08:16 PST 2015


 vcl/source/gdi/pdfwriter_impl.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 811c746985a72339ad8a1b78dae45738a030ecb9
Author: Pedro Giffuni <pfg at apache.org>
Date:   Tue Dec 1 22:53:35 2015 +0000

    Prevent division by zero
    
    CID:	735658, 735659

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index a0b135a..bee62eb 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8929,9 +8929,9 @@ static double calcAngle( const Rectangle& rRect, const Point& rPoint )
     double fX = (double)aPoint.X();
     double fY = (double)-aPoint.Y();
 
-    if( rRect.GetWidth() > rRect.GetHeight() )
+    if((rRect.GetWidth() > rRect.GetHeight()) && (rRect.GetHeight() != 0 ))
         fY = fY*((double)rRect.GetWidth()/(double)rRect.GetHeight());
-    else if( rRect.GetHeight() > rRect.GetWidth() )
+    else if((rRect.GetHeight() > rRect.GetWidth()) && (rRect.GetWidth() != 0))
         fX = fX*((double)rRect.GetHeight()/(double)rRect.GetWidth());
     return atan2( fY, fX );
 }


More information about the Libreoffice-commits mailing list