[Libreoffice-commits] core.git: 3 commits - connectivity/source extensions/source vcl/opengl

Caolán McNamara caolanm at redhat.com
Sat Jan 31 12:16:29 PST 2015


 connectivity/source/drivers/file/FResultSet.cxx |   11 ++++-------
 extensions/source/update/ui/updatecheckui.cxx   |    4 ++--
 vcl/opengl/gdiimpl.cxx                          |   12 +++++-------
 3 files changed, 11 insertions(+), 16 deletions(-)

New commits:
commit eaf1c5f85bcf33fbb7e0ad0d6de4b33ae07445ae
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 31 19:14:02 2015 +0000

    coverity#1267680 Dereference before null check
    
    Change-Id: I4a7e8751a5a6a93bd0cb8208a06a7c4fd30ef1b4

diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx
index cccb034..6f6d30b 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -735,8 +735,8 @@ IMPL_LINK( UpdateCheckUI, ApplicationEventHdl, VclSimpleEvent *, pEvent)
             if ( pWindow && pWindow->IsTopWindow() )
             {
                 SystemWindow *pSysWin = pWindow->GetSystemWindow();
-                MenuBar      *pMBar   = pSysWin->GetMenuBar();
-                if ( pSysWin && pMBar )
+                MenuBar *pMBar = pSysWin ? pSysWin->GetMenuBar() : NULL;
+                if (pMBar)
                 {
                     AddMenuBarIcon( pSysWin, true );
                 }
commit fed1ed0a17a770e9b4c75ef4737032f9ad2e154a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 31 19:06:52 2015 +0000

    coverity#1267670 Division or modulo by float zero
    
    and
    
    coverity#1267699 Division or modulo by float zero
    
    Change-Id: If31037712208673438155b30369ebe1068387cba

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 854c090..dcede20 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -934,23 +934,21 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture(
             return;
     }
 
-    if( areaScaling )
+    int mnWidth = rTexture.GetWidth();
+    int mnHeight = rTexture.GetHeight();
+    if(areaScaling )
     {
         // From OpenGLSalBitmap::ImplScaleArea().
-        if( fastAreaScaling )
+        if (fastAreaScaling && mnWidth && mnHeight)
         {
-            int mnWidth = rTexture.GetWidth();
-            int mnHeight = rTexture.GetHeight();
             mpProgram->SetUniform1i( "xscale", ixscale );
             mpProgram->SetUniform1i( "yscale", iyscale );
             mpProgram->SetUniform1f( "xstep", 1.0 / mnWidth );
             mpProgram->SetUniform1f( "ystep", 1.0 / mnHeight );
             mpProgram->SetUniform1f( "ratio", 1.0 / ( ixscale * iyscale ));
         }
-        else
+        else if (mnHeight > 1 && mnWidth > 1)
         {
-            int mnWidth = rTexture.GetWidth();
-            int mnHeight = rTexture.GetHeight();
             mpProgram->SetUniform1f( "xscale", ixscale );
             mpProgram->SetUniform1f( "yscale", iyscale );
             mpProgram->SetUniform1i( "swidth", mnWidth );
commit 1fb386749d9f9c599a08edcaef7848c82c95a38f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 31 19:04:05 2015 +0000

    coverity#1267674 Dereference after null check
    
    Change-Id: I735e95a25b32d11b58ab3b187bfaac41b2f91e10

diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index afc9d96..1394f93 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1676,13 +1676,10 @@ Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getP
 
 void OResultSet::doTableSpecials(const OSQLTable& _xTable)
 {
-    Reference< ::com::sun::star::lang::XUnoTunnel> xTunnel(_xTable,UNO_QUERY);
-    if(xTunnel.is())
-    {
-        m_pTable = reinterpret_cast< OFileTable* >( xTunnel->getSomething(OFileTable::getUnoTunnelImplementationId()) );
-        if(m_pTable)
-            m_pTable->acquire();
-    }
+    Reference<css::lang::XUnoTunnel> xTunnel(_xTable, UNO_QUERY_THROW);
+    m_pTable = reinterpret_cast< OFileTable* >(xTunnel->getSomething(OFileTable::getUnoTunnelImplementationId()));
+    assert(m_pTable);
+    m_pTable->acquire();
 }
 
 void OResultSet::clearInsertRow()


More information about the Libreoffice-commits mailing list