summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-18 14:15:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-18 15:36:18 +0100
commit724c242f1ddd30f26e2ea08fb1571788a78bf4da (patch)
treeeca7a91bd1d7ec17e173486d05daff648dbbf42d
parentebdb4a00fa3daaae49b0e20a122284056cc5b846 (diff)
coverity#704477 Division or modulo by float zero
Change-Id: If229ad014851f46ccad5f8aec24cbf0bd2781b5e
-rw-r--r--filter/source/flash/swfwriter1.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index c487accfa769..9ea53e5bf819 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -892,8 +892,8 @@ void Writer::Impl_writeImage( const BitmapEx& rBmpEx, const Point& rPt, const Si
// AS: Christian, my scaling factors are different than yours, and work better for me.
// However, I can't explain why exactly. I got some of this by trial and error.
- double XScale = static_cast<double>(originalPixelRect.GetWidth())/destRect.GetWidth();
- double YScale = static_cast<double>(originalPixelRect.GetHeight())/destRect.GetHeight();
+ double XScale = destRect.GetWidth() ? static_cast<double>(originalPixelRect.GetWidth())/destRect.GetWidth() : 1.0;;
+ double YScale = destRect.GetHeight() ? static_cast<double>(originalPixelRect.GetHeight())/destRect.GetHeight() : 1.0;;
// AS: If rClipRect has a value set, then we need to crop the bmp appropriately.
// If a map event already occurred in the metafile, then we do not need to map