diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-20 10:43:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-20 10:57:22 +0100 |
commit | 90fbb7086c711dbb21770f5d364bdb0abc909573 (patch) | |
tree | c1c1bdef55fb3814d0f86ba622f64ebb4648f8bf /svx | |
parent | 366c658c77d02fd8d82116ca49640ee87c92f933 (diff) |
coverity#735639 Division or modulo by float zero
Change-Id: I2ba45c49fb00fdd53b8e388e25df503e82c2332e
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
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; |