diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-18 14:15:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-18 15:36:18 +0100 |
commit | 724c242f1ddd30f26e2ea08fb1571788a78bf4da (patch) | |
tree | eca7a91bd1d7ec17e173486d05daff648dbbf42d /filter/source/flash | |
parent | ebdb4a00fa3daaae49b0e20a122284056cc5b846 (diff) |
coverity#704477 Division or modulo by float zero
Change-Id: If229ad014851f46ccad5f8aec24cbf0bd2781b5e
Diffstat (limited to 'filter/source/flash')
-rw-r--r-- | filter/source/flash/swfwriter1.cxx | 4 |
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 |