From 90fbb7086c711dbb21770f5d364bdb0abc909573 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 20 Oct 2014 10:43:44 +0100 Subject: coverity#735639 Division or modulo by float zero Change-Id: I2ba45c49fb00fdd53b8e388e25df503e82c2332e --- svx/source/xoutdev/_xoutbmp.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'svx') diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index da0ca012376a..0a16759726e8 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -494,11 +494,12 @@ Polygon XOutBitmap::GetCountour( const Bitmap& rBmp, const sal_uIntPtr nFlags, BitmapReadAccess* pAcc = aWorkBmp.AcquireReadAccess(); - if( pAcc ) + const long nWidth = pAcc ? pAcc->Width() : 0; + const long nHeight = pAcc ? pAcc->Height() : 0; + + if (pAcc && nWidth && nHeight) { const Size& rPrefSize = aWorkBmp.GetPrefSize(); - const long nWidth = pAcc->Width(); - const long nHeight = pAcc->Height(); const double fFactorX = (double) rPrefSize.Width() / nWidth; const double fFactorY = (double) rPrefSize.Height() / nHeight; const long nStartX1 = aWorkRect.Left() + 1L; -- cgit