[Libreoffice-commits] core.git: 11 commits - connectivity/source filter/source sd/CppunitTest_sd_filters_test.mk sd/qa svtools/source

Caolán McNamara caolanm at redhat.com
Tue Oct 14 09:14:16 PDT 2014


 connectivity/source/drivers/jdbc/InputStream.cxx |    2 
 filter/source/graphicfilter/icgm/actimpr.cxx     |   67 ---
 filter/source/graphicfilter/icgm/bundles.cxx     |   10 
 filter/source/graphicfilter/icgm/cgm.cxx         |   41 +-
 filter/source/graphicfilter/icgm/cgm.hxx         |    5 
 filter/source/graphicfilter/icgm/outact.cxx      |   33 -
 sd/CppunitTest_sd_filters_test.mk                |    6 
 sd/qa/unit/data/cgm/fail/ooo6420-1.cgm           |  400 +++++++++++++++++++++++
 sd/qa/unit/data/cgm/pass/circles.cgm             |binary
 sd/qa/unit/filters-test.cxx                      |    4 
 svtools/source/control/tabbar.cxx                |    7 
 11 files changed, 471 insertions(+), 104 deletions(-)

New commits:
commit b13591d48f58b45f4465ce03bd1248ec1e95584f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 15:34:53 2014 +0100

    valgrind: init GroupLevels
    
    Change-Id: Idccebc826ade29a507e115108d20fd461b7bb4ec

diff --git a/filter/source/graphicfilter/icgm/outact.cxx b/filter/source/graphicfilter/icgm/outact.cxx
index 7d09983..283b35c 100644
--- a/filter/source/graphicfilter/icgm/outact.cxx
+++ b/filter/source/graphicfilter/icgm/outact.cxx
@@ -28,7 +28,7 @@ CGMOutAct::CGMOutAct( CGM& rCGM )
     mpCGM = &rCGM;
     mnCurrentPage = 0;
     mnGroupActCount = mnGroupLevel = 0;
-    mpGroupLevel = new sal_uInt32[ CGM_OUTACT_MAX_GROUP_LEVEL ];
+    mpGroupLevel = new sal_uInt32[CGM_OUTACT_MAX_GROUP_LEVEL] {};
     mpPoints = (Point*)new sal_Int8[ 0x2000 * sizeof( Point ) ];
     mpFlags = new sal_uInt8[ 0x2000 ];
 
@@ -41,9 +41,7 @@ CGMOutAct::~CGMOutAct()
     delete[] (sal_Int8*) mpPoints;
     delete[] mpFlags;
     delete[] mpGroupLevel;
-
-    if ( mpGradient )
-        delete mpGradient;
+    delete mpGradient;
 }
 
 void CGMOutAct::BeginFigure()
commit 740617901dc2e7a1effd211c755ea9d00b32094b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 15:00:31 2014 +0100

    stray ;s all other the place
    
    Change-Id: If67bf3361e082c1321f42ae7717cc941dc96e74b

diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index ad03946..03df394 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -74,9 +74,7 @@ CGMImpressOutAct::CGMImpressOutAct( CGM& rCGM, const uno::Reference< frame::XMod
         }
         mpCGM->mbStatus = bStatRet;
     }
-};
-
-
+}
 
 bool CGMImpressOutAct::ImplInitPage()
 {
@@ -176,9 +174,7 @@ void CGMImpressOutAct::ImplSetLineBundle()
         aAny <<= aLineDash;
         maXPropSet->setPropertyValue( "LineDash", aAny );
     }
-};
-
-
+}
 
 void CGMImpressOutAct::ImplSetFillBundle()
 {
@@ -343,9 +339,7 @@ void CGMImpressOutAct::ImplSetFillBundle()
         aAny <<= aHatch;
         maXPropSet->setPropertyValue( "FillHatch", aAny );
     }
-};
-
-
+}
 
 void CGMImpressOutAct::ImplSetTextBundle( const uno::Reference< beans::XPropertySet > & rProperty )
 {
@@ -387,9 +381,7 @@ void CGMImpressOutAct::ImplSetTextBundle( const uno::Reference< beans::XProperty
     }
     aAny <<= aFontDescriptor;
     rProperty->setPropertyValue( "FontDescriptor", aAny );
-};
-
-
+}
 
 void CGMImpressOutAct::InsertPage()
 {
@@ -401,9 +393,7 @@ void CGMImpressOutAct::InsertPage()
             mpCGM->mbStatus = false;
     }
     mnCurrentPage++;
-};
-
-
+}
 
 void CGMImpressOutAct::BeginGroup()
 {
@@ -413,9 +403,7 @@ void CGMImpressOutAct::BeginGroup()
     }
     mnGroupLevel++;
     mnGroupActCount = mpCGM->mnActCount;
-};
-
-
+}
 
 void CGMImpressOutAct::EndGroup()
 {
@@ -446,9 +434,7 @@ void CGMImpressOutAct::EndGroup()
             }
         }
     }
-};
-
-
+}
 
 void CGMImpressOutAct::EndGrouping()
 {
@@ -458,8 +444,6 @@ void CGMImpressOutAct::EndGrouping()
     }
 }
 
-
-
 void CGMImpressOutAct::DrawRectangle( FloatRect& rFloatRect )
 {
     if ( mnGroupActCount != ( mpCGM->mnActCount - 1 ) )         // POWERPOINT HACK !!!
@@ -472,9 +456,7 @@ void CGMImpressOutAct::DrawRectangle( FloatRect& rFloatRect )
             ImplSetFillBundle();
         }
     }
-};
-
-
+}
 
 void CGMImpressOutAct::DrawEllipse( FloatPoint& rCenter, FloatPoint& rSize, double& rOrientation )
 {
@@ -499,9 +481,7 @@ void CGMImpressOutAct::DrawEllipse( FloatPoint& rCenter, FloatPoint& rSize, doub
         }
         ImplSetFillBundle();
     }
-};
-
-
+}
 
 void CGMImpressOutAct::DrawEllipticalArc( FloatPoint& rCenter, FloatPoint& rSize, double& rOrientation,
             sal_uInt32 nType, double& fStartAngle, double& fEndAngle )
@@ -572,9 +552,7 @@ void CGMImpressOutAct::DrawEllipticalArc( FloatPoint& rCenter, FloatPoint& rSize
             }
         }
     }
-};
-
-
+}
 
 void CGMImpressOutAct::DrawBitmap( CGMBitmapDescriptor* pBmpDesc )
 {
@@ -613,9 +591,7 @@ void CGMImpressOutAct::DrawBitmap( CGMBitmapDescriptor* pBmpDesc )
 
         }
     }
-};
-
-
+}
 
 void CGMImpressOutAct::DrawPolygon( Polygon& rPoly )
 {
@@ -645,10 +621,7 @@ void CGMImpressOutAct::DrawPolygon( Polygon& rPoly )
         maXPropSet->setPropertyValue( "PolyPolygon", aParam );
         ImplSetFillBundle();
     }
-};
-
-
-
+}
 
 void CGMImpressOutAct::DrawPolyLine( Polygon& rPoly )
 {
@@ -678,9 +651,7 @@ void CGMImpressOutAct::DrawPolyLine( Polygon& rPoly )
         maXPropSet->setPropertyValue( "PolyPolygon", aParam );
         ImplSetLineBundle();
     }
-};
-
-
+}
 
 void CGMImpressOutAct::DrawPolybezier( Polygon& rPolygon )
 {
@@ -713,9 +684,7 @@ void CGMImpressOutAct::DrawPolybezier( Polygon& rPolygon )
         maXPropSet->setPropertyValue( "PolyPolygonBezier", aParam );
         ImplSetLineBundle();
     }
-};
-
-
+}
 
 void CGMImpressOutAct::DrawPolyPolygon( tools::PolyPolygon& rPolyPolygon )
 {
@@ -758,9 +727,7 @@ void CGMImpressOutAct::DrawPolyPolygon( tools::PolyPolygon& rPolyPolygon )
         maXPropSet->setPropertyValue( "PolyPolygonBezier", aParam);
         ImplSetFillBundle();
     }
-};
-
-
+}
 
 void CGMImpressOutAct::DrawText( awt::Point& rTextPos, awt::Size& rTextSize, char* pString, sal_uInt32 /*nSize*/, FinalFlag eFlag )
 {
@@ -907,9 +874,7 @@ void CGMImpressOutAct::DrawText( awt::Point& rTextPos, awt::Size& rTextSize, cha
             nFinalTextCount = maXShapes->getCount();
         }
     }
-};
-
-
+}
 
 void CGMImpressOutAct::AppendText( char* pString, sal_uInt32 /*nSize*/, FinalFlag /*eFlag*/ )
 {
diff --git a/filter/source/graphicfilter/icgm/outact.cxx b/filter/source/graphicfilter/icgm/outact.cxx
index f7394df..7d09983 100644
--- a/filter/source/graphicfilter/icgm/outact.cxx
+++ b/filter/source/graphicfilter/icgm/outact.cxx
@@ -23,8 +23,6 @@
 
 using namespace ::com::sun::star;
 
-
-
 CGMOutAct::CGMOutAct( CGM& rCGM )
 {
     mpCGM = &rCGM;
@@ -36,9 +34,7 @@ CGMOutAct::CGMOutAct( CGM& rCGM )
 
     mnIndex = 0;
     mpGradient = NULL;
-};
-
-
+}
 
 CGMOutAct::~CGMOutAct()
 {
@@ -48,9 +44,7 @@ CGMOutAct::~CGMOutAct()
 
     if ( mpGradient )
         delete mpGradient;
-};
-
-
+}
 
 void CGMOutAct::BeginFigure()
 {
@@ -61,8 +55,6 @@ void CGMOutAct::BeginFigure()
     mnIndex = 0;
 }
 
-
-
 void CGMOutAct::CloseRegion()
 {
     if ( mnIndex > 2 )
@@ -73,8 +65,6 @@ void CGMOutAct::CloseRegion()
     }
 }
 
-
-
 void CGMOutAct::NewRegion()
 {
     if ( mnIndex > 2 )
@@ -85,8 +75,6 @@ void CGMOutAct::NewRegion()
     mnIndex = 0;
 }
 
-
-
 void CGMOutAct::EndFigure()
 {
     NewRegion();
@@ -96,8 +84,6 @@ void CGMOutAct::EndFigure()
     mnIndex = 0;
 }
 
-
-
 void CGMOutAct::RegPolyLine( Polygon& rPolygon, bool bReverse )
 {
     sal_uInt16 nPoints = rPolygon.GetSize();
@@ -123,8 +109,6 @@ void CGMOutAct::RegPolyLine( Polygon& rPolygon, bool bReverse )
     }
 }
 
-
-
 void CGMOutAct::SetGradientOffset( long nHorzOfs, long nVertOfs, sal_uInt32 /*nType*/ )
 {
     if ( !mpGradient )
@@ -133,8 +117,6 @@ void CGMOutAct::SetGradientOffset( long nHorzOfs, long nVertOfs, sal_uInt32 /*nT
     mpGradient->YOffset = ( (sal_uInt16)nVertOfs & 0x7f );
 }
 
-
-
 void CGMOutAct::SetGradientAngle( long nAngle )
 {
     if ( !mpGradient )
@@ -142,8 +124,6 @@ void CGMOutAct::SetGradientAngle( long nAngle )
     mpGradient->Angle = sal::static_int_cast< sal_Int16 >(nAngle);
 }
 
-
-
 void CGMOutAct::SetGradientDescriptor( sal_uInt32 nColorFrom, sal_uInt32 nColorTo )
 {
     if ( !mpGradient )
@@ -152,8 +132,6 @@ void CGMOutAct::SetGradientDescriptor( sal_uInt32 nColorFrom, sal_uInt32 nColorT
     mpGradient->EndColor = nColorTo;
 }
 
-
-
 void CGMOutAct::SetGradientStyle( sal_uInt32 nStyle, double /*fRatio*/ )
 {
     if ( !mpGradient )
@@ -187,5 +165,4 @@ void CGMOutAct::SetGradientStyle( sal_uInt32 nStyle, double /*fRatio*/ )
     }
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b251762c6549639975a7e9962c9fb5b365ef2063
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 14:37:44 2014 +0100

    valgrind: multiple errors
    
    Change-Id: Ic0ee492710650165004ad05f523424ba1b094473

diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index 7f17fd4..b032020 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -57,6 +57,7 @@ CGM::CGM( sal_uInt32 nMode, uno::Reference< frame::XModel > & rModel )
     , mpChart(NULL)
     , mpOutAct(new CGMImpressOutAct(*this, rModel))
     , mpSource(NULL)
+    , mpEndValidSource(NULL)
     , mnParaSize(0)
     , mnActCount(0)
     , mpBuf(NULL)
@@ -102,6 +103,8 @@ sal_uInt32 CGM::GetBackGroundColor()
 sal_uInt32 CGM::ImplGetUI16( sal_uInt32 /*nAlign*/ )
 {
     sal_uInt8* pSource = mpSource + mnParaSize;
+    if (pSource + 2 > mpEndValidSource)
+        throw css::uno::Exception("attempt to read past end of input", 0);
     mnParaSize += 2;
     return ( pSource[ 0 ] << 8 ) +  pSource[ 1 ];
 };
@@ -114,6 +117,8 @@ sal_uInt8 CGM::ImplGetByte( sal_uInt32 nSource, sal_uInt32 nPrecision )
 sal_Int32 CGM::ImplGetI( sal_uInt32 nPrecision )
 {
     sal_uInt8* pSource = mpSource + mnParaSize;
+    if (pSource + nPrecision > mpEndValidSource)
+        throw css::uno::Exception("attempt to read past end of input", 0);
     mnParaSize += nPrecision;
     switch( nPrecision )
     {
@@ -144,6 +149,8 @@ sal_Int32 CGM::ImplGetI( sal_uInt32 nPrecision )
 sal_uInt32 CGM::ImplGetUI( sal_uInt32 nPrecision )
 {
     sal_uInt8* pSource = mpSource + mnParaSize;
+    if (pSource + nPrecision > mpEndValidSource)
+        throw css::uno::Exception("attempt to read past end of input", 0);
     mnParaSize += nPrecision;
     switch( nPrecision )
     {
@@ -193,12 +200,18 @@ double CGM::ImplGetFloat( RealPrecision eRealPrecision, sal_uInt32 nRealSize )
     float   fFloatBuf;
 
 #ifdef OSL_BIGENDIAN
-        bCompatible = true;
+    bCompatible = true;
 #else
-        bCompatible = false;
+    bCompatible = false;
 #endif
+
+    if (mpSource + mnParaSize + nRealSize > mpEndValidSource)
+        throw css::uno::Exception("attempt to read past end of input", 0);
+
     if ( bCompatible )
+    {
         pPtr = mpSource + mnParaSize;
+    }
     else
     {
         if ( nRealSize == 4 )
@@ -619,11 +632,13 @@ void CGM::ImplDefaultReplacement()
         sal_uInt32  nOldElementID = mnElementID;
         sal_uInt32  nOldElementSize = mnElementSize;
         sal_uInt8*  pOldBuf = mpSource;
+        sal_uInt8*  pOldEndValidSource = mpEndValidSource;
 
         for ( size_t i = 0, n = maDefRepList.size(); i < n; ++i )
         {
             sal_uInt8*  pBuf = maDefRepList[ i ];
             sal_uInt32  nElementSize = maDefRepSizeList[ i ];
+            mpEndValidSource = pBuf + nElementSize;
             sal_uInt32  nCount = 0;
             while ( mbStatus && ( nCount < nElementSize ) )
             {
@@ -652,6 +667,7 @@ void CGM::ImplDefaultReplacement()
         mnElementID = nOldElementID;
         mnParaSize = mnElementSize = nOldElementSize;
         mpSource = pOldBuf;
+        mpEndValidSource = pOldEndValidSource;
     }
 }
 
@@ -664,6 +680,7 @@ bool CGM::Write( SvStream& rIStm )
     mpSource = mpBuf;
     if (rIStm.Read(mpSource, 2) != 2)
         return false;
+    mpEndValidSource = mpSource + 2;
     mnEscape = ImplGetUI16();
     mnElementClass = mnEscape >> 12;
     mnElementID = ( mnEscape & 0x0fe0 ) >> 5;
@@ -673,13 +690,15 @@ bool CGM::Write( SvStream& rIStm )
     {
         if (rIStm.Read(mpSource + mnParaSize, 2) != 2)
             return false;
+        mpEndValidSource = mpSource + mnParaSize + 2;
         mnElementSize = ImplGetUI16();
     }
     mnParaSize = 0;
     if (mnElementSize)
     {
-        if (rIStm.Read(mpSource + mnParaSize, mnElementSize) != mnElementSize)
+        if (rIStm.Read(mpSource, mnElementSize) != mnElementSize)
             return false;
+        mpEndValidSource = mpSource + mnElementSize;
     }
 
     if ( mnElementSize & 1 )
@@ -748,7 +767,7 @@ ImportCGM( OUString& rFileName, uno::Reference< frame::XModel > & rXModel, sal_u
                 }
             }
         }
-        catch( const ::com::sun::star::uno::Exception& )
+        catch (const css::uno::Exception&)
         {
             nStatus = 0;
         }
diff --git a/filter/source/graphicfilter/icgm/cgm.hxx b/filter/source/graphicfilter/icgm/cgm.hxx
index e1e7f63..fb302b0 100644
--- a/filter/source/graphicfilter/icgm/cgm.hxx
+++ b/filter/source/graphicfilter/icgm/cgm.hxx
@@ -79,8 +79,9 @@ class CGM
         ::std::vector< sal_uInt8 * > maDefRepList;
         ::std::vector< sal_uInt32  > maDefRepSizeList;
 
-        sal_uInt8*              mpSource;       // source buffer that is not increased
-                                            // ( instead use mnParaCount to index )
+        sal_uInt8*              mpSource;         // start of source buffer that is not increased
+                                                  // ( instead use mnParaCount to index )
+        sal_uInt8*              mpEndValidSource; // end position in source buffer of last valid data
         sal_uInt32              mnParaSize;     // actual parameter size which has been done so far
         sal_uInt32              mnActCount;     // increased by each action
         sal_uInt8*              mpBuf;          // source stream operation -> then this is allocated for
commit 2e234939874575a41673b3ceb4a759afa3b333aa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 13:41:01 2014 +0100

    check for short reads
    
    Change-Id: I98a7d77cabe0207ff2b0190ccef47b87d1552930

diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index cc27666..7f17fd4 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -662,7 +662,8 @@ bool CGM::Write( SvStream& rIStm )
 
     mnParaSize = 0;
     mpSource = mpBuf;
-    rIStm.Read( mpSource, 2 );
+    if (rIStm.Read(mpSource, 2) != 2)
+        return false;
     mnEscape = ImplGetUI16();
     mnElementClass = mnEscape >> 12;
     mnElementID = ( mnEscape & 0x0fe0 ) >> 5;
@@ -670,12 +671,16 @@ bool CGM::Write( SvStream& rIStm )
 
     if ( mnElementSize == 31 )
     {
-        rIStm.Read( mpSource + mnParaSize, 2 );
+        if (rIStm.Read(mpSource + mnParaSize, 2) != 2)
+            return false;
         mnElementSize = ImplGetUI16();
     }
     mnParaSize = 0;
-    if ( mnElementSize )
-        rIStm.Read( mpSource + mnParaSize, mnElementSize );
+    if (mnElementSize)
+    {
+        if (rIStm.Read(mpSource + mnParaSize, mnElementSize) != mnElementSize)
+            return false;
+    }
 
     if ( mnElementSize & 1 )
         rIStm.SeekRel( 1 );
commit aeea1cab4300371797fc1283c1e8623fa8238908
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 13:38:58 2014 +0100

    sal_True->true
    
    Change-Id: Idbbc50afbb229dca1b62a7a0d1b2eeec9b0418d5

diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index 95557cb..cc27666 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -193,7 +193,7 @@ double CGM::ImplGetFloat( RealPrecision eRealPrecision, sal_uInt32 nRealSize )
     float   fFloatBuf;
 
 #ifdef OSL_BIGENDIAN
-        bCompatible = sal_True;
+        bCompatible = true;
 #else
         bCompatible = false;
 #endif
commit b2b5bc10b6574e4717f651602c970bdb20abd1a7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 13:21:37 2014 +0100

    valgrind: Source and destination overlap in memcpy
    
    Change-Id: I0b83a1955b6752c1253cfd7992a50b932aac078d

diff --git a/filter/source/graphicfilter/icgm/bundles.cxx b/filter/source/graphicfilter/icgm/bundles.cxx
index 8ec42c5..17d1156 100644
--- a/filter/source/graphicfilter/icgm/bundles.cxx
+++ b/filter/source/graphicfilter/icgm/bundles.cxx
@@ -201,7 +201,7 @@ void CGMFList::InsertName( sal_uInt8* pSource, sal_uInt32 nSize )
         sal_uInt32 nToCopy = nSize - nToCopyOfs - nPrev;
         if ( nToCopy )
         {
-            memcpy( pFound, pFound + nToCopyOfs, nToCopy );
+            memmove( pFound, pFound + nToCopyOfs, nToCopy );
         }
         nSize -= nToCopyOfs;
     }
@@ -221,7 +221,7 @@ void CGMFList::InsertName( sal_uInt8* pSource, sal_uInt32 nSize )
         sal_uInt32 nToCopy = nSize - nToCopyOfs - nPrev;
         if ( nToCopy )
         {
-            memcpy( pFound, pFound + nToCopyOfs, nToCopy );
+            memmove( pFound, pFound + nToCopyOfs, nToCopy );
         }
         nSize -= nToCopyOfs;
     }
commit 61550120b45640898677c7f765a491737445954f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 13:19:10 2014 +0100

    valgrind: Mismatched free() / delete / delete []
    
    Change-Id: I78a9e08fb3535f9fe6c61a6e192c7aff4ef0c527

diff --git a/filter/source/graphicfilter/icgm/bundles.cxx b/filter/source/graphicfilter/icgm/bundles.cxx
index fe2180b..8ec42c5 100644
--- a/filter/source/graphicfilter/icgm/bundles.cxx
+++ b/filter/source/graphicfilter/icgm/bundles.cxx
@@ -83,8 +83,6 @@ FillBundle& FillBundle::operator=( FillBundle& rSource )
     return *this;
 };
 
-
-
 FontEntry::FontEntry() :
     pFontName       ( NULL ),
     eCharSetType    ( CST_CCOMPLETE ),
@@ -95,12 +93,10 @@ FontEntry::FontEntry() :
 
 FontEntry::~FontEntry()
 {
-    delete pFontName;
+    delete [] pFontName;
     delete pCharSetValue;
 }
 
-
-
 CGMFList::CGMFList() :
     nFontNameCount      ( 0 ),
     nCharSetCount       ( 0 ),
commit 4d82ccb1edcc700f1ff8387ec51ac8114d5d77e3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 13:16:49 2014 +0100

    valgrind: Mismatched free() / delete / delete []
    
    Change-Id: I293229dabb9a04f2e76b556e9da66921328ebe23

diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index 2e73107..95557cb 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -74,7 +74,6 @@ CGM::CGM( sal_uInt32 nMode, uno::Reference< frame::XModel > & rModel )
 
 CGM::~CGM()
 {
-
     if ( mpGraphic )
     {
         mpGDIMetaFile->Stop();
@@ -84,7 +83,7 @@ CGM::~CGM()
         *mpGraphic = Graphic( *mpGDIMetaFile );
     }
     for( size_t i = 0, n = maDefRepList.size(); i < n; ++i )
-        delete maDefRepList[ i ];
+        delete [] maDefRepList[i];
     maDefRepList.clear();
     maDefRepSizeList.clear();
     delete mpBitmapInUse;
commit ff7c2cd0dc89f0ffa6742f1f5dcf89f5a6f03839
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 11:32:50 2014 +0100

    Resolves: fdo#84887 TabBar::ImplShowPage crash
    
    Change-Id: I84250c6a40baeabd0d12958dfe0aea346d2b4fc8

diff --git a/sd/CppunitTest_sd_filters_test.mk b/sd/CppunitTest_sd_filters_test.mk
index f149e13..0831080 100644
--- a/sd/CppunitTest_sd_filters_test.mk
+++ b/sd/CppunitTest_sd_filters_test.mk
@@ -102,6 +102,9 @@ $(eval $(call gb_CppunitTest_use_components,sd_filters_test,\
 
 $(eval $(call gb_CppunitTest_use_configuration,sd_filters_test))
 
-$(call gb_CppunitTest_get_target,sd_filters_test) : $(call gb_AllLangResTarget_get_target,sd)
+# sd dlopens libicg.so for cgm import, so ensure its built by now
+$(call gb_CppunitTest_get_target,sd_filters_test) : | \
+    $(call gb_AllLangResTarget_get_target,sd) \
+    $(call gb_Library_get_target,icg) \
 
 # vim: set noet sw=4 ts=4:
diff --git a/sd/qa/unit/data/cgm/fail/ooo6420-1.cgm b/sd/qa/unit/data/cgm/fail/ooo6420-1.cgm
new file mode 100644
index 0000000..5b42b6f
--- /dev/null
+++ b/sd/qa/unit/data/cgm/fail/ooo6420-1.cgm
@@ -0,0 +1,400 @@
+BEGMF 'xfig-fig012228';
+mfversion 1;
+mfdesc 'Converted from /tmp/xfig-fig012228 using fig2dev -Lcgm';
+mfelemlist 'DRAWINGPLUS';
+vdctype integer;
+fontlist 'Hardware',
+  'Times New Roman', 'Times New Roman Bold', 'Times New Roman Italic',
+  'Helvetica', 'Courier',
+  'Times-Roman', 'Times-Italic',
+  'Times-Bold', 'Times-BoldItalic',
+  'AvantGarde-Book', 'AvantGarde-BookOblique',
+  'AvantGarde-Demi', 'AvantGarde-DemiOblique',
+  'Bookman-light', 'Bookman-lightItalic',
+  'Bookman-Demi', 'Bookman-DemiItalic',
+  'Courier', 'Courier-Oblique',
+  'Courier-Bold', 'Courier-BoldOblique',
+  'Helvetica', 'Helvetica-Oblique',
+  'Helvetica-Bold', 'Helvetica-BoldOblique',
+  'Helvetica-Narrow', 'Helvetica-Narrow-Oblique',
+  'Helvetica-Narrow-Bold', 'Helvetica-Narrow-BoldOblique',
+  'NewCenturySchlbk-Roman', 'NewCenturySchlbk-Italic',
+  'NewCenturySchlbk-Bold', 'NewCenturySchlbk-BoldItalic',
+  'Palatino-Roman', 'Palatino-Italic',
+  'Palatino-Bold', 'Palatino-BoldItalic',
+  'Symbol', 'ZapfChancery-MediumItalic', 'ZapfDingbats';
+BEGMFDEFAULTS;
+  vdcext (0,0) (12974,8467);
+  clip off;
+  colrmode indexed;
+  colrtable 1
+    0 0 0
+    0 0 255
+    0 255 0
+    0 255 255
+    255 0 0
+    255 0 255
+    255 255 0
+    255 255 255
+    0 0 142
+    0 0 175
+    0 0 209
+    135 206 255
+    0 142 0
+    0 175 0
+    0 209 0
+    0 142 142
+    0 175 175
+    0 209 209
+    142 0 0
+    175 0 0
+    209 0 0
+    142 0 142
+    175 0 175
+    209 0 209
+    127 48 0
+    160 63 0
+    191 96 0
+    255 127 127
+    255 160 160
+    255 191 191
+    255 224 224
+    255 214 0;
+  linewidthmode abs;
+  edgewidthmode abs;
+  backcolr 255 255 255;
+  textprec stroke;
+  transparency ON;
+ENDMFDEFAULTS;
+BEGPIC 'xfig-fig012228';
+BEGPICBODY;
+% Circle %
+intstyle EMPTY;
+edgevis ON;
+edgetype 1;
+edgewidth 30;
+edgecolr 1;
+circle (7747,5647) 225;
+% Polygon %
+polygon (2797,6997) (3697,5197) (2797,3397) (2797,6997);
+% Polyline %
+linetype 1;
+linewidth 30;
+linecolr 1;
+line (3697,5197) (3907,5197);
+intstyle SOLID;
+fillcolr 1;
+polygon (3847,5257)(4087,5197)(3847,5137);
+% Polyline %
+line (772,4747) (2797,4747);
+% Polyline %
+line (772,3847) (2797,3847);
+% Polyline %
+line (997,472) (8422,472);
+% Polyline %
+line (997,1372) (8422,1372);
+% Polyline %
+line (6622,2272) (8422,2272);
+% Box %
+intstyle EMPTY;
+rect (5497,4522) (6622,3622);
+% Polyline %
+line (6622,4072) (6880,4072);
+intstyle SOLID;
+fillcolr 8;
+polygon (6772,4132)(7012,4072)(6772,4012)(6820,4072);
+% Polygon %
+intstyle EMPTY;
+polygon (8422,3622) (9322,1822) (8422,22) (8422,3622);
+% Polyline %
+line (9322,1822) (9532,1822);
+intstyle SOLID;
+fillcolr 1;
+polygon (9472,1882)(9712,1822)(9472,1762);
+% Polyline %
+line (9772,3397) (9772,4522) (7747,4522) (7747,5182);
+polygon (7687,5122)(7747,5362)(7807,5122);
+% Polyline %
+line (772,6322) (772,7387);
+line (712,7147)(772,7387)(832,7147);
+% Polyline %
+line (772,5647) (2797,5647);
+% Polyline %
+line (322,6322) (1672,6322) (1672,5647);
+% Polyline %
+line (9772,4522) (10222,4522);
+% Polyline %
+line (10447,4522) (12472,4522) (12472,8122) (322,8122) (322,6322);
+% Polyline %
+line (9772,3397) (9772,697) (11062,697);
+line (10822,757)(11062,697)(10822,637);
+% Polyline %
+line (9772,2722) (11962,2722);
+line (11722,2782)(11962,2722)(11722,2662);
+% Polyline %
+line (10537,3622) (10537,3847) (12022,3847);
+% Polyline %
+line (10222,4522) (10222,3397) (11962,3397);
+line (11722,3457)(11962,3397)(11722,3337);
+% Polyline %
+line (10222,4072) (11962,4072);
+line (11722,4132)(11962,4072)(11722,4012);
+% Polyline %
+line (4147,7222) (4147,4072) (5257,4072);
+polygon (5197,4132)(5437,4072)(5197,4012);
+% Polyline %
+line (4147,7222) (8182,7222);
+polygon (8122,7282)(8362,7222)(8122,7162);
+% Polyline %
+line (10837,7672) (8422,7672) (8422,6772) (10837,6772);
+line (10597,7732)(10837,7672)(10597,7612);
+line (10597,6832)(10837,6772)(10597,6712);
+% Polyline %
+line (4147,6322) (7747,6322) (7747,6112);
+polygon (7807,6172)(7747,5932)(7687,6172);
+% Polyline %
+line (7972,5647) (8182,5647);
+polygon (8122,5707)(8362,5647)(8122,5587);
+% Polyline %
+line (1672,6547) (1882,6547);
+polygon (1822,6607)(2062,6547)(1822,6487);
+% Polyline %
+line (10987,3847) (10777,3847);
+polygon (10837,3787)(10597,3847)(10837,3907);
+% Polyline %
+line (9772,4522) (9982,4522);
+polygon (9922,4582)(10162,4522)(9922,4462);
+% Polyline %
+line (10942,4522) (10732,4522);
+polygon (10792,4462)(10552,4522)(10792,4582);
+% Box %
+intstyle EMPTY;
+rect (5497,2722) (6622,1822);
+% Polyline %
+line (5047,2272) (5305,2272);
+intstyle SOLID;
+fillcolr 8;
+polygon (5197,2332)(5437,2272)(5197,2212)(5245,2272);
+% Polyline %
+line (1447,7447) (1447,6547) (2572,6547);
+% Polyline %
+line (10837,6097) (8422,6097) (8422,5197) (10837,5197);
+line (10597,6157)(10837,6097)(10597,6037);
+line (10597,5257)(10837,5197)(10597,5137);
+% Polyline %
+line (2077,6547) (2797,6547);
+% Text %
+textfontindex 25;
+textalign right base 0.0 0.0;
+textcolr 1;
+charheight 140;
+charori (0,1200) (1200,0);
+text (862,1282) final 'FMS_IN';
+% Text %
+text (862,382) final 'WFB_IN';
+% Text %
+textalign left base 0.0 0.0;
+text (7162,3982) final 'NET';
+% Text %
+text (5767,4207) final 'PCM';
+% Text %
+text (5767,3892) final 'capture';
+% Text %
+textalign ctr base 0.0 0.0;
+text (1222,7582) final 'DECRYPT';
+% Text %
+textalign left base 0.0 0.0;
+text (12067,3892) final 'CRYPT';
+% Text %
+text (10042,2047) final 'SE_OUT';
+% Text %
+text (9997,1012) final 'GS_OUT';
+% Text %
+textalign right base 0.0 0.0;
+text (8197,1642) final 'FMS_IN';
+% Text %
+text (8197,742) final 'WFB_IN';
+% Text %
+text (4912,2182) final 'NET';
+% Text %
+textalign left base 0.0 0.0;
+text (5767,2407) final 'PCM';
+% Text %
+text (5767,2092) final 'receive';
+% Text %
+text (4327,4612) final 'NET_CAPTURE';
+% Text %
+text (4372,6592) final 'LSTA_OUT';
+% Text %
+text (4372,7492) final 'FMS_OUT';
+% Text %
+textalign right base 0.0 0.0;
+text (2662,6817) final 'CYUN_IN';
+% Text %
+text (2572,5917) final 'SE_IN';
+% Text %
+text (2572,5017) final 'PA_IN';
+% Text %
+text (2572,4117) final 'GS_IN';
+% Text %
+text (8332,2542) final 'NET_RECEIVE';
+% Text %
+textalign left base 0.0 0.0;
+text (2932,5107) final 'LEFT';
+% Text %
+text (8512,1732) final 'RIGHT';
+% Text %
+textalign right base 0.0 0.0;
+text (682,4657) final 'PA_IN';
+% Text %
+text (682,3757) final 'GS_IN';
+% Text %
+text (682,5557) final 'SE_IN';
+% Text %
+textalign left base 0.0 0.0;
+text (10987,7582) final 'FMS_OUT';
+% Text %
+text (10987,6682) final 'WFB_OUT';
+% Text %
+text (10987,6007) final 'TA_OUT';
+% Text %
+text (10987,5107) final 'LS_OUT';
+% Text %
+text (12067,2632) final 'PA_OUT';
+% Text %
+text (11212,607) final 'GS_OUT';
+% Text %
+textalign ctr base 0.0 0.0;
+text (11302,3577) final 'OL-SE';
+% Text %
+text (9997,5377) final 'OL-LS';
+% Text %
+text (9997,6277) final 'OL-TA';
+% Text %
+text (6172,8302) final 'LOOP-RS';
+% Text %
+text (1222,5827) final 'IL-SE';
+% Text %
+text (11347,2902) final 'OL-PA';
+% Text %
+textalign left base 0.0 0.0;
+text (12067,3307) final 'SE_OUT';
+% Text %
+textalign ctr base 0.0 0.0;
+text (10312,4612) final 'RS1';
+% Text %
+textalign left base 0.0 0.0;
+text (8197,4657) final 'TA_BACK';
+% Text %
+textalign ctr base 0.0 0.0;
+text (9097,5512) final 'LS_ON';
+% Text %
+text (9097,6412) final 'TA_ON';
+% Text %
+text (10357,2992) final 'PA_ON';
+% Polygon %
+colrtable 33 255 255 255;
+fillcolr 33;
+polygon (2122,6772) (2122,6322) (2572,6547) (2122,6772);
+% Polygon %
+polygon (2122,5872) (2122,5422) (2572,5647) (2122,5872);
+% Polygon %
+polygon (2122,4972) (2122,4522) (2572,4747) (2122,4972);
+% Polygon %
+polygon (2122,4072) (2122,3622) (2572,3847) (2122,4072);
+% Polygon %
+polygon (4372,4297) (4372,3847) (4822,4072) (4372,4297);
+% Polygon %
+polygon (9997,922) (9997,472) (10447,697) (9997,922);
+% Polygon %
+polygon (7747,2497) (7747,2047) (8197,2272) (7747,2497);
+% Polygon %
+polygon (7747,1597) (7747,1147) (8197,1372) (7747,1597);
+% Polygon %
+polygon (7747,697) (7747,247) (8197,472) (7747,697);
+% Polygon %
+polygon (9547,2047) (9997,2047) (9772,2497) (9547,2047);
+% Box %
+rect (997,5782) (1447,5512);
+% Box %
+rect (5947,8257) (6397,7987);
+% Box %
+rect (11122,2857) (11572,2587);
+% Box %
+rect (11122,3532) (11572,3262);
+% Polygon %
+polygon (4372,7447) (4372,6997) (4822,7222) (4372,7447);
+% Polygon %
+polygon (4372,6547) (4372,6097) (4822,6322) (4372,6547);
+% Box %
+rect (9772,6232) (10222,5962);
+% Box %
+rect (9772,5332) (10222,5062);
+% Polyline %
+linewidth 45;
+linecolr 8;
+line (8332,4522) (8017,4522);
+% Polyline %
+line (10222,4207) (10222,4522);
+% Polyline %
+line (10222,2722) (10537,2722);
+% Polyline %
+line (10852,3397) (10537,3397);
+% Polyline %
+line (8917,5197) (9232,5197);
+% Polyline %
+line (8917,6097) (9232,6097);
+% Polyline %
+linewidth 30;
+linecolr 1;
+line (8332,4522) (8017,4657);
+% Polyline %
+line (10222,4207) (10357,4522);
+% Polyline %
+line (10222,2722) (10537,2857);
+% Polyline %
+line (10852,3397) (10537,3532);
+% Polyline %
+line (8917,5197) (9232,5332);
+% Polyline %
+line (8917,6097) (9232,6232);
+% Circle %
+edgewidth 15;
+circle (8332,4522) 45;
+% Circle %
+circle (8017,4522) 45;
+% Circle %
+circle (8017,4747) 45;
+% Circle %
+circle (10222,4207) 45;
+% Circle %
+circle (10222,4522) 45;
+% Circle %
+circle (10447,4522) 45;
+% Circle %
+circle (10222,2722) 45;
+% Circle %
+circle (10537,2722) 45;
+% Circle %
+circle (10537,2947) 45;
+% Circle %
+circle (10852,3397) 45;
+% Circle %
+circle (10537,3397) 45;
+% Circle %
+circle (10537,3622) 45;
+% Circle %
+circle (8917,5197) 45;
+% Circle %
+circle (9232,5197) 45;
+% Circle %
+circle (9232,5422) 45;
+% Circle %
+circle (8917,6097) 45;
+% Circle %
+circle (9232,6322) 45;
+% Circle %
+circle (9232,6097) 45;
+% End of Picture %
+ENDPIC;
+ENDMF;
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 20d570b..dc4b199 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -788,10 +788,11 @@ void TabBar::SetScrollAlwaysEnabled(bool bScrollAlwaysEnabled)
     ImplEnableControls();
 }
 
-
-
 void TabBar::ImplShowPage( sal_uInt16 nPos )
 {
+    if (nPos >= mpItemList->size())
+        return;
+
     // calculate width
     long nWidth = GetOutputSizePixel().Width();
 
@@ -811,8 +812,6 @@ void TabBar::ImplShowPage( sal_uInt16 nPos )
     }
 }
 
-
-
 IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
 {
     EndEditMode();
commit 9e8a593b44a3acb97297439f3d93be2c673a3625
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 14 10:44:13 2014 +0100

    add cgm loading test
    
    Change-Id: Icb1732d867d86e2a1b180ce58cec4c91fc630881

diff --git a/sd/CppunitTest_sd_filters_test.mk b/sd/CppunitTest_sd_filters_test.mk
index 43a8d13..f149e13 100644
--- a/sd/CppunitTest_sd_filters_test.mk
+++ b/sd/CppunitTest_sd_filters_test.mk
@@ -89,6 +89,7 @@ $(eval $(call gb_CppunitTest_use_components,sd_filters_test,\
     sfx2/util/sfx \
     sot/util/sot \
     svtools/util/svt \
+    svx/util/svx \
     toolkit/util/tk \
     ucb/source/core/ucb1 \
     ucb/source/ucp/file/ucpfile1 \
diff --git a/sd/qa/unit/data/cgm/fail/.gitignore b/sd/qa/unit/data/cgm/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sd/qa/unit/data/cgm/indeterminate/.gitignore b/sd/qa/unit/data/cgm/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sd/qa/unit/data/cgm/pass/.gitignore b/sd/qa/unit/data/cgm/pass/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sd/qa/unit/data/cgm/pass/circles.cgm b/sd/qa/unit/data/cgm/pass/circles.cgm
new file mode 100644
index 0000000..d31c1b4
Binary files /dev/null and b/sd/qa/unit/data/cgm/pass/circles.cgm differ
diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx
index 7879a06..1d18531 100644
--- a/sd/qa/unit/filters-test.cxx
+++ b/sd/qa/unit/filters-test.cxx
@@ -91,6 +91,10 @@ void SdFiltersTest::testCVEs()
     testDir(OUString("draw8"),
             getURLFromSrc("/sd/qa/unit/data/odg/"),
             OUString("sdfilt"));
+
+    testDir(OUString("CGM - Computer Graphics Metafile"),
+            getURLFromSrc("/sd/qa/unit/data/cgm/"),
+            OUString("icg"));
 #endif
 }
 
commit 298f8d6032adceebd6429e4decc8f177835e1c33
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 13 10:14:12 2014 +0100

    coverity#706320 Uncaught exception
    
    Change-Id: I980e55ab3942c93447573c0af7b7486dfc0a0e10

diff --git a/connectivity/source/drivers/jdbc/InputStream.cxx b/connectivity/source/drivers/jdbc/InputStream.cxx
index 5edeaef..41afbe8 100644
--- a/connectivity/source/drivers/jdbc/InputStream.cxx
+++ b/connectivity/source/drivers/jdbc/InputStream.cxx
@@ -68,7 +68,7 @@ void SAL_CALL java_io_InputStream::skipBytes( sal_Int32 nBytesToSkip ) throw(::c
 sal_Int32 SAL_CALL java_io_InputStream::available(  ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception)
 {
     static jmethodID mID(NULL);
-    return callIntMethod_Throw("available", mID);
+    return callIntMethod_Nothrow("available", mID);
 }
 
 void SAL_CALL java_io_InputStream::closeInput(  ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception)


More information about the Libreoffice-commits mailing list