diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-25 15:04:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-25 20:42:01 +0000 |
commit | 2b95714814b60a3d703525a7a5df453e5b87988c (patch) | |
tree | a34e5a4ae987e0c0f8e58a6bd76b49e6a942e097 | |
parent | e3c70196e7f640cfde360b9832e91bec4eb7ab26 (diff) |
coverity#982431 Division or modulo by float zero
and
coverity#982432 Division or modulo by float zero
Change-Id: I1b9036d85c4b31b8136a96d330d95d7b024530aa
-rw-r--r-- | vcl/source/filter/wmf/winwmf.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index aef13a19e5a3..3c8ed8b14ef4 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -250,6 +250,11 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) { short nXNum = 0, nXDenom = 0, nYNum = 0, nYDenom = 0; pWMF->ReadInt16( nYDenom ).ReadInt16( nYNum ).ReadInt16( nXDenom ).ReadInt16( nXNum ); + if (!nYDenom || !nXDenom) + { + pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); + break; + } pOut->ScaleDevExt( (double)nXNum / nXDenom, (double)nYNum / nYDenom ); } break; |