From 2b95714814b60a3d703525a7a5df453e5b87988c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 25 Jan 2015 15:04:48 +0000 Subject: [PATCH] coverity#982431 Division or modulo by float zero and coverity#982432 Division or modulo by float zero Change-Id: I1b9036d85c4b31b8136a96d330d95d7b024530aa --- vcl/source/filter/wmf/winwmf.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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;