Kaydet (Commit) 89819732 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#704475 Division or modulo by float zero

and coverity#704477
and coverity#704479
and coverity#704480

Change-Id: I505d499b39a37bdba33e13917aaf1519f0624bcf
üst af142a08
...@@ -940,8 +940,8 @@ void Writer::Impl_writeImage( const BitmapEx& rBmpEx, const Point& rPt, const Si ...@@ -940,8 +940,8 @@ void Writer::Impl_writeImage( const BitmapEx& rBmpEx, const Point& rPt, const Si
Size szDestPixel = mpVDev->LogicToPixel(srcSize, aTWIPSMode); Size szDestPixel = mpVDev->LogicToPixel(srcSize, aTWIPSMode);
double pixXScale = static_cast<double>(szDestPixel.Width()) / originalPixelRect.GetWidth(); double pixXScale = originalPixelRect.GetWidth() ? static_cast<double>(szDestPixel.Width()) / originalPixelRect.GetWidth() : 1.0;
double pixYScale = static_cast<double>(szDestPixel.Height()) / originalPixelRect.GetHeight(); double pixYScale = originalPixelRect.GetHeight() ? static_cast<double>(szDestPixel.Height()) / originalPixelRect.GetHeight() : 1.0;
// AS: If the image has been scaled down, then scale down the quality // AS: If the image has been scaled down, then scale down the quality
// that we use for JPEG compression. // that we use for JPEG compression.
...@@ -1272,8 +1272,8 @@ bool Writer::Impl_writeFilling( SvtGraphicFill& rFilling ) ...@@ -1272,8 +1272,8 @@ bool Writer::Impl_writeFilling( SvtGraphicFill& rFilling )
aMatrix.set(2, 2, 1.0); aMatrix.set(2, 2, 1.0);
// scale bitmap // scale bitmap
double XScale = (double)aNewRect.GetWidth()/aOldRect.GetWidth(); double XScale = aOldRect.GetWidth() ? (double)aNewRect.GetWidth()/aOldRect.GetWidth() : 1.0;
double YScale = (double)aNewRect.GetHeight()/aOldRect.GetHeight(); double YScale = aOldRect.GetHeight() ? (double)aNewRect.GetHeight()/aOldRect.GetHeight() : 1.0;
aMatrix.scale( XScale, YScale ); aMatrix.scale( XScale, YScale );
......
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