Kaydet (Commit) 2fe0d7bc authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

coverity#704538-9 Division by zero

Change-Id: Ia77648c3e0442bb5e0a08d01bbd495c9d7c8bbf5
üst 982c6ab3
...@@ -410,9 +410,16 @@ void ...@@ -410,9 +410,16 @@ void
PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc, PrinterGfx::DrawBitmap (const Rectangle& rDest, const Rectangle& rSrc,
const PrinterBmp& rBitmap) const PrinterBmp& rBitmap)
{ {
double fScaleX = (double)rDest.GetWidth() / (double)rSrc.GetWidth(); double fScaleX = (double)rDest.GetWidth();
double fScaleY = (double)rDest.GetHeight() / (double)rSrc.GetHeight(); double fScaleY = (double)rDest.GetHeight();
if(rSrc.GetWidth() > 0)
{
fScaleX = (double)rDest.GetWidth() / (double)rSrc.GetWidth();
}
if(rSrc.GetHeigth() > 0)
{
fScaleY = (double)rDest.GetHeight() / (double)rSrc.GetHeight();
}
PSGSave (); PSGSave ();
PSTranslate (rDest.BottomLeft()); PSTranslate (rDest.BottomLeft());
PSScale (fScaleX, fScaleY); PSScale (fScaleX, fScaleY);
......
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