[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Sun Jan 25 12:43:54 PST 2015


 vcl/source/filter/wmf/winwmf.cxx |    5 +++++
 vcl/unx/generic/gdi/gdiimpl.cxx  |    2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 2b95714814b60a3d703525a7a5df453e5b87988c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 25 15:04:48 2015 +0000

    coverity#982431 Division or modulo by float zero
    
    and
    
    coverity#982432 Division or modulo by float zero
    
    Change-Id: I1b9036d85c4b31b8136a96d330d95d7b024530aa

diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index aef13a1..3c8ed8b 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;
commit e3c70196e7f640cfde360b9832e91bec4eb7ab26
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 25 14:44:20 2015 +0000

    coverity#1266437 Unintended comparison to logical negation
    
    Change-Id: Ia4fc4ccbdfe3586afc78a16378ef0b3859308d64

diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 7eddf05..17a9a10 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -1230,7 +1230,7 @@ void X11SalGraphicsImpl::SetROPFillColor( SalROPColor nROPColor )
 
 void X11SalGraphicsImpl::SetXORMode( bool bSet, bool )
 {
-    if( !mbXORMode == bSet )
+    if (mbXORMode != bSet)
     {
         mbXORMode   = bSet;
         mbPenGC     = false;


More information about the Libreoffice-commits mailing list