[Libreoffice-commits] core.git: 5 commits - basic/source filter/source include/filter o3tl/qa oox/source

Caolán McNamara caolanm at redhat.com
Tue Sep 1 01:40:55 PDT 2015


 basic/source/classes/image.cxx              |   12 ++-
 filter/source/msfilter/dffrecordheader.cxx  |    4 -
 filter/source/msfilter/msdffimp.cxx         |  108 +++++++++++++++-------------
 filter/source/msfilter/svdfppt.cxx          |   24 +++---
 include/filter/msfilter/dffrecordheader.hxx |    2 
 o3tl/qa/cow_wrapper_clients.hxx             |    5 -
 oox/source/ppt/slidefragmenthandler.cxx     |    2 
 7 files changed, 88 insertions(+), 69 deletions(-)

New commits:
commit c874bf3f7bd6bbe31416506d9b4213bcbbbac4fa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 1 09:39:58 2015 +0100

    Resolves: tdf#91060 don't crash on loading certain pptx
    
    Change-Id: Ibf32ef644222a59c5fe6a9736ff64739ab24b74f

diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 95ea839..5a27ea3 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -194,7 +194,7 @@ SlideFragmentHandler::~SlideFragmentHandler()
     case PPT_TOKEN( cmLst ):
         break;
     case PPT_TOKEN( cm ):
-        if(!mpSlidePersistPtr->getCommentsList().cmLst.empty())
+        if (!mpSlidePersistPtr->getCommentsList().cmLst.empty() && !getCharVector().empty())
         {
             // set comment text for earlier comment
             mpSlidePersistPtr->getCommentsList().cmLst.back().setText( getCharVector().back() );
commit 79f060d45122ac108de8482d44af17a82ee1c48d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 1 09:25:54 2015 +0100

    coverity#1242865 Untrusted loop bound
    
    Change-Id: I9332fa9b805e702fb56067efc308aff09310f603

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 3faabae..12eff18 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -258,8 +258,16 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
                 {
                     OUString aTypeName = r.ReadUniOrByteString(eCharSet);
 
-                    sal_Int16 nTypeMembers;
-                    r.ReadInt16(nTypeMembers);
+                    sal_uInt16 nTypeMembers;
+                    r.ReadUInt16(nTypeMembers);
+
+                    const size_t nMaxTypeMembers = r.remainingSize() / 8;
+                    if (nTypeMembers > nMaxTypeMembers)
+                    {
+                        SAL_WARN("basic", "Parsing error: " << nMaxTypeMembers <<
+                                 " max possible entries, but " << nTypeMembers << " claimed, truncating");
+                        nTypeMembers = nMaxTypeMembers;
+                    }
 
                     SbxObject *pType = new SbxObject(aTypeName);
                     SbxArray *pTypeMembers = pType->GetProperties();
commit 5b8e4f3d676eb0a026ce1eb4c1df2ec6e0736cb1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 1 09:17:53 2015 +0100

    coverity#1321598 Resource leak in object
    
    and
    
    coverity#1321597 Resource leak in object
    
    Change-Id: I6e9e517a394bea60c1f0550b17bacd653eee5cbc

diff --git a/o3tl/qa/cow_wrapper_clients.hxx b/o3tl/qa/cow_wrapper_clients.hxx
index 8ca04f8..f5d4de6 100644
--- a/o3tl/qa/cow_wrapper_clients.hxx
+++ b/o3tl/qa/cow_wrapper_clients.hxx
@@ -162,16 +162,15 @@ struct BogusRefCountPolicy
         {
             --rCount;
             --s_nEndOfScope;
-            return true;
         }
-        if(s_bShouldDecrement)
+        else if(s_bShouldDecrement)
         {
             --rCount;
             s_bShouldDecrement = false;
         }
         else
             CPPUNIT_FAIL("Ref-counting policy decremented when it should not have.");
-        return true;
+        return rCount != 0;
     }
 };
 
commit cefbbd5c325b57688c3b43883a6ad9c3e6809815
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 1 09:12:10 2015 +0100

    coverity#1321600 Dereference before null check
    
    Change-Id: I5a2e61200333ca57af990d3d7be3899da836472a

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 561ac50..679759f 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2559,24 +2559,20 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor )
                 }
                 if ( pMasterPersist )
                 {
-                    while( ( pMasterPersist && pMasterPersist->aSlideAtom.nFlags & 2 )  // it is possible that a masterpage
-                        && pMasterPersist->aSlideAtom.nMasterId )                        // itself is following a master colorscheme
+                    while( (pMasterPersist->aSlideAtom.nFlags & 2) // it is possible that a masterpage
+                        && pMasterPersist->aSlideAtom.nMasterId )  // itself is following a master colorscheme
                     {
                         auto nOrigMasterId = pMasterPersist->aSlideAtom.nMasterId;
                         sal_uInt16 nNextMaster = m_pMasterPages->FindPage(nOrigMasterId);
-                        if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
+                        if (nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND)
                             break;
-                        else
-                            pMasterPersist = &(*pPageList2)[ nNextMaster ];
+                        pMasterPersist = &(*pPageList2)[ nNextMaster ];
                         if (pMasterPersist->aSlideAtom.nMasterId == nOrigMasterId)
                         {
                             SAL_WARN("filter.ms", "loop in atom chain");
                             break;
                         }
                     }
-                }
-                if ( pMasterPersist )
-                {
                     const_cast<SdrPowerPointImport*>(this)->aPageColors = pMasterPersist->aColorScheme;
                 }
             }
commit 239c25ff95b665717e87f3e4cf5aa6c29e4deb72
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 31 20:43:29 2015 +0100

    check for error more frequently
    
    Change-Id: I909c225dd9bd92763ae24b62854a9217fc2e2a0e

diff --git a/filter/source/msfilter/dffrecordheader.cxx b/filter/source/msfilter/dffrecordheader.cxx
index 232e2cf..e0adfe9 100644
--- a/filter/source/msfilter/dffrecordheader.cxx
+++ b/filter/source/msfilter/dffrecordheader.cxx
@@ -19,7 +19,7 @@
 
 #include <filter/msfilter/dffrecordheader.hxx>
 
-SvStream& ReadDffRecordHeader( SvStream& rIn, DffRecordHeader& rRec )
+bool ReadDffRecordHeader( SvStream& rIn, DffRecordHeader& rRec )
 {
     rRec.nFilePos = rIn.Tell();
     sal_uInt16 nTmp(0);
@@ -35,7 +35,7 @@ SvStream& ReadDffRecordHeader( SvStream& rIn, DffRecordHeader& rRec )
     if ( rRec.nRecLen > ( SAL_MAX_UINT32 - rRec.nFilePos ) )
       rIn.SetError( SVSTREAM_FILEFORMAT_ERROR );
 
-    return rIn;
+    return rIn.good();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 6c723a8..e334400 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -226,8 +226,8 @@ void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, sal_uInt32 nOffsDg
     sal_uInt32 nMerk = rStCtrl.Tell();
     rStCtrl.Seek( nOffsDgg );
     DffRecordHeader aRecHd;
-    ReadDffRecordHeader( rStCtrl, aRecHd );
-    if ( aRecHd.nRecType == DFF_msofbtDggContainer )
+    bool bOk = ReadDffRecordHeader( rStCtrl, aRecHd );
+    if (bOk && aRecHd.nRecType == DFF_msofbtDggContainer)
     {
         if ( SvxMSDffManager::SeekToRec( rStCtrl, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
         {
@@ -252,8 +252,8 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
         if ( rManager.SeekToShape( rIn, pClientData, GetPropertyValue( DFF_Prop_hspMaster, 0 ) ) )
         {
             DffRecordHeader aRecHd;
-            ReadDffRecordHeader( rIn, aRecHd );
-            if ( SvxMSDffManager::SeekToRec( rIn, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
+            bool bOk = ReadDffRecordHeader(rIn, aRecHd);
+            if (bOk && SvxMSDffManager::SeekToRec(rIn, DFF_msofbtOPT, aRecHd.GetRecEndFilePos()))
             {
                 rIn |= (DffPropertyReader&)*this;
             }
@@ -406,14 +406,15 @@ SvxMSDffSolverContainer::~SvxMSDffSolverContainer()
 SvStream& ReadSvxMSDffSolverContainer( SvStream& rIn, SvxMSDffSolverContainer& rContainer )
 {
     DffRecordHeader aHd;
-    ReadDffRecordHeader( rIn, aHd );
-    if ( aHd.nRecType == DFF_msofbtSolverContainer )
+    bool bOk = ReadDffRecordHeader( rIn, aHd );
+    if (bOk && aHd.nRecType == DFF_msofbtSolverContainer)
     {
         DffRecordHeader aCRule;
         auto nEndPos = DffPropSet::SanitizeEndPos(rIn, aHd.GetRecEndFilePos());
-        while ( ( rIn.GetError() == 0 ) && ( rIn.Tell() < nEndPos ) )
+        while ( rIn.good() && ( rIn.Tell() < nEndPos ) )
         {
-            ReadDffRecordHeader( rIn, aCRule );
+            if (!ReadDffRecordHeader(rIn, aCRule))
+                break;
             if ( aCRule.nRecType == DFF_msofbtConnectorRule )
             {
                 SvxMSDffConnectorRule* pRule = new SvxMSDffConnectorRule;
@@ -2939,8 +2940,8 @@ void DffRecordManager::Consume( SvStream& rIn, bool bAppend, sal_uInt32 nStOfs )
     if ( !nStOfs )
     {
         DffRecordHeader aHd;
-        ReadDffRecordHeader( rIn, aHd );
-        if ( aHd.nRecVer == DFF_PSFLAG_CONTAINER )
+        bool bOk = ReadDffRecordHeader( rIn, aHd );
+        if (bOk && aHd.nRecVer == DFF_PSFLAG_CONTAINER)
             nStOfs = aHd.GetRecEndFilePos();
     }
     if ( nStOfs )
@@ -2948,11 +2949,12 @@ void DffRecordManager::Consume( SvStream& rIn, bool bAppend, sal_uInt32 nStOfs )
         pCList = static_cast<DffRecordList*>(this);
         while ( pCList->pNext )
             pCList = pCList->pNext;
-        while ( ( rIn.GetError() == 0 ) && ( ( rIn.Tell() + 8 ) <=  nStOfs ) )
+        while (rIn.good() && ( ( rIn.Tell() + 8 ) <=  nStOfs ))
         {
             if ( pCList->nCount == DFF_RECORD_MANAGER_BUF_SIZE )
                 pCList = new DffRecordList( pCList );
-            ReadDffRecordHeader( rIn, pCList->mHd[ pCList->nCount ] );
+            if (!ReadDffRecordHeader(rIn, pCList->mHd[ pCList->nCount ]))
+                break;
             bool bSeekSucceeded = pCList->mHd[ pCList->nCount++ ].SeekToEndOfRecord(rIn);
             if (!bSeekSucceeded)
                 break;
@@ -3212,12 +3214,13 @@ bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, sal_u
                 sal_IntPtr nOfs = it->second;
                 rSt.Seek( nOfs );
                 DffRecordHeader aEscherF002Hd;
-                ReadDffRecordHeader( rSt, aEscherF002Hd );
-                sal_uLong nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
-                DffRecordHeader aEscherObjListHd;
+                bool bOk = ReadDffRecordHeader( rSt, aEscherF002Hd );
+                sal_uLong nEscherF002End = bOk ? aEscherF002Hd.GetRecEndFilePos() : 0;
                 while (rSt.good() && rSt.Tell() < nEscherF002End)
                 {
-                    ReadDffRecordHeader( rSt, aEscherObjListHd );
+                    DffRecordHeader aEscherObjListHd;
+                    if (!ReadDffRecordHeader(rSt, aEscherObjListHd))
+                        break;
                     if ( aEscherObjListHd.nRecVer != 0xf )
                         aEscherObjListHd.SeekToEndOfRecord( rSt );
                     else if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
@@ -3248,11 +3251,10 @@ bool SvxMSDffManager::SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMa
 {
     bool bRet = false;
     sal_uLong nFPosMerk = rSt.Tell(); // store FilePos to restore it later if necessary
-    DffRecordHeader aHd;
     do
     {
-        ReadDffRecordHeader( rSt, aHd );
-        if (!rSt.good())
+        DffRecordHeader aHd;
+        if (!ReadDffRecordHeader(rSt, aHd))
             break;
         if (aHd.nRecLen > nMaxLegalDffRecordLength)
             break;
@@ -3293,10 +3295,11 @@ bool SvxMSDffManager::SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uL
 {
     bool bRet = false;
     sal_uLong nFPosMerk = rStCtrl.Tell();   // remember FilePos for conditionally later restoration
-    DffRecordHeader aHd;
     do
     {
-        ReadDffRecordHeader( rStCtrl, aHd );
+        DffRecordHeader aHd;
+        if (!ReadDffRecordHeader(rStCtrl, aHd))
+            break;
         if ( aHd.nRecType == nRecId1 || aHd.nRecType == nRecId2 )
         {
             if ( nSkipCount )
@@ -3591,13 +3594,15 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte
 void SvxMSDffManager::ReadObjText( SvStream& rStream, SdrObject* pObj )
 {
     DffRecordHeader aRecHd;
-    ReadDffRecordHeader( rStream, aRecHd );
+    if (!ReadDffRecordHeader(rStream, aRecHd))
+        return;
     if( aRecHd.nRecType == DFF_msofbtClientTextbox || aRecHd.nRecType == 0x1022 )
     {
-        while( rStream.GetError() == 0 && rStream.Tell() < aRecHd.GetRecEndFilePos() )
+        while (rStream.good() && rStream.Tell() < aRecHd.GetRecEndFilePos())
         {
             DffRecordHeader aHd;
-            ReadDffRecordHeader( rStream, aHd );
+            if (!ReadDffRecordHeader(rStream, aHd))
+                break;
             switch( aHd.nRecType )
             {
                 case DFF_PST_TextBytesAtom:
@@ -3800,8 +3805,8 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
                 */
                 rObjData.rSpHd.SeekToEndOfRecord( rSt );
                 DffRecordHeader aHd;
-                ReadDffRecordHeader( rSt, aHd );
-                if( DFF_msofbtBSE == aHd.nRecType )
+                bool bOk = ReadDffRecordHeader(rSt, aHd);
+                if (bOk && DFF_msofbtBSE == aHd.nRecType)
                 {
                     const sal_uLong nSkipBLIPLen = 20;
                     const sal_uLong nSkipShapePos = 4;
@@ -4027,12 +4032,12 @@ SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, void* pClientData,
 {
     SdrObject* pRet = NULL;
     DffRecordHeader aObjHd;
-    ReadDffRecordHeader( rSt, aObjHd );
-    if ( aObjHd.nRecType == DFF_msofbtSpgrContainer )
+    bool bOk = ReadDffRecordHeader(rSt, aObjHd);
+    if (bOk && aObjHd.nRecType == DFF_msofbtSpgrContainer)
     {
         pRet = ImportGroup( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
     }
-    else if ( aObjHd.nRecType == DFF_msofbtSpContainer )
+    else if (bOk && aObjHd.nRecType == DFF_msofbtSpContainer)
     {
         pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
     }
@@ -4053,8 +4058,8 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
         return pRet;
 
     DffRecordHeader aRecHd;     // the first atom has to be the SpContainer for the GroupObject
-    ReadDffRecordHeader( rSt, aRecHd );
-    if ( aRecHd.nRecType == DFF_msofbtSpContainer )
+    bool bOk = ReadDffRecordHeader(rSt, aRecHd);
+    if (bOk && aRecHd.nRecType == DFF_msofbtSpContainer)
     {
         mnFix16Angle = 0;
         if (!aRecHd.SeekToBegOfRecord(rSt))
@@ -4092,10 +4097,11 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
             if (!aRecHd.SeekToEndOfRecord(rSt))
                 return pRet;
 
-            while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
+            while (rSt.good() && ( rSt.Tell() < rHd.GetRecEndFilePos()))
             {
                 DffRecordHeader aRecHd2;
-                ReadDffRecordHeader( rSt, aRecHd2 );
+                if (!ReadDffRecordHeader(rSt, aRecHd2))
+                    break;
                 if ( aRecHd2.nRecType == DFF_msofbtSpgrContainer )
                 {
                     Rectangle aGroupClientAnchor, aGroupChildAnchor;
@@ -4836,17 +4842,19 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
     while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
     {
         DffRecordHeader aShapeHd;
-        ReadDffRecordHeader( rSt, aShapeHd );
+        if (!ReadDffRecordHeader(rSt, aShapeHd))
+            break;
         if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
                 ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
         {
             DffRecordHeader aShapeHd2( aShapeHd );
             if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
                 ReadDffRecordHeader( rSt, aShapeHd2 );
-            while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
+            while (rSt.good() && rSt.Tell() < aShapeHd2.GetRecEndFilePos())
             {
                 DffRecordHeader aShapeAtom;
-                ReadDffRecordHeader( rSt, aShapeAtom );
+                if (!ReadDffRecordHeader(rSt, aShapeAtom))
+                    break;
 
                 if ( aShapeAtom.nRecType == DFF_msofbtClientAnchor )
                 {
@@ -4911,19 +4919,21 @@ void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt
 
     bool bFirst = true;
     DffRecordHeader aShapeHd;
-    while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
+    while (rSt.good() && rSt.Tell() < rHd.GetRecEndFilePos())
     {
-        ReadDffRecordHeader( rSt, aShapeHd );
+        if (!ReadDffRecordHeader(rSt, aShapeHd))
+            break;
         if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
                 ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
         {
             DffRecordHeader aShapeHd2( aShapeHd );
             if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
                 ReadDffRecordHeader( rSt, aShapeHd2 );
-            while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
+            while (rSt.good() && rSt.Tell() < aShapeHd2.GetRecEndFilePos())
             {
                 DffRecordHeader aShapeAtom;
-                ReadDffRecordHeader( rSt, aShapeAtom );
+                if (!ReadDffRecordHeader(rSt, aShapeAtom))
+                    break;
                 if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
                 {
                     sal_Int32 l, o, r, u;
@@ -5669,16 +5679,18 @@ void SvxMSDffManager::SetDgContainer( SvStream& rSt )
 {
     sal_uInt32 nFilePos = rSt.Tell();
     DffRecordHeader aDgContHd;
-    ReadDffRecordHeader( rSt, aDgContHd );
+    bool bOk = ReadDffRecordHeader(rSt, aDgContHd);
     // insert this container only if there is also a DggAtom
-    if ( SeekToRec( rSt, DFF_msofbtDg, aDgContHd.GetRecEndFilePos() ) )
+    if (bOk && SeekToRec(rSt, DFF_msofbtDg, aDgContHd.GetRecEndFilePos()))
     {
         DffRecordHeader aRecHd;
-        ReadDffRecordHeader( rSt, aRecHd );
-        sal_uInt32 nDrawingId = aRecHd.nRecInstance;
-        maDgOffsetTable[ nDrawingId ] = nFilePos;
-        rSt.Seek( nFilePos );
+        if (ReadDffRecordHeader(rSt, aRecHd))
+        {
+            sal_uInt32 nDrawingId = aRecHd.nRecInstance;
+            maDgOffsetTable[nDrawingId] = nFilePos;
+        }
     }
+    rSt.Seek(nFilePos);
 }
 
 void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL )
@@ -5691,10 +5703,10 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL )
     if (nOffsDggL == rStCtrl.Seek(nOffsDggL))
     {
         DffRecordHeader aRecHd;
-        ReadDffRecordHeader( rStCtrl, aRecHd );
+        bool bOk = ReadDffRecordHeader(rStCtrl, aRecHd);
 
         DffRecordHeader aDggAtomHd;
-        if ( SeekToRec( rStCtrl, DFF_msofbtDgg, aRecHd.GetRecEndFilePos(), &aDggAtomHd ) )
+        if (bOk && SeekToRec(rStCtrl, DFF_msofbtDgg, aRecHd.GetRecEndFilePos(), &aDggAtomHd))
         {
             aDggAtomHd.SeekToContent( rStCtrl );
             rStCtrl.ReadUInt32( mnCurMaxShapeId )
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 744b5e9..561ac50 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -189,7 +189,8 @@ void PptSlidePersistAtom::Clear()
 SvStream& ReadPptSlidePersistAtom( SvStream& rIn, PptSlidePersistAtom& rAtom )
 {
     DffRecordHeader aHd;
-    ReadDffRecordHeader( rIn, aHd )
+    ReadDffRecordHeader( rIn, aHd );
+    rIn
        .ReadUInt32( rAtom.nPsrReference )
        .ReadUInt32( rAtom.nFlags )
        .ReadUInt32( rAtom.nNumberTexts )
@@ -266,7 +267,8 @@ SvStream& ReadPptDocumentAtom(SvStream& rIn, PptDocumentAtom& rAtom)
     sal_uInt16  nSlidePageFormat;
     sal_Int8    nEmbeddedTrueType, nTitlePlaceHoldersOmitted, nRightToLeft, nShowComments;
 
-    ReadDffRecordHeader( rIn, aHd )
+    ReadDffRecordHeader( rIn, aHd );
+    rIn
        .ReadInt32( nSlideX ).ReadInt32( nSlideY )
        .ReadInt32( nNoticeX ).ReadInt32( nNoticeY )
        .ReadInt32( nDummy ).ReadInt32( nDummy )             // skip ZoomRation
@@ -328,7 +330,8 @@ void PptSlideAtom::Clear()
 SvStream& ReadPptNotesAtom( SvStream& rIn, PptNotesAtom& rAtom )
 {
     DffRecordHeader aHd;
-    ReadDffRecordHeader( rIn, aHd )
+    ReadDffRecordHeader( rIn, aHd );
+    rIn
        .ReadUInt32( rAtom.nSlideId )
        .ReadUInt16( rAtom.nFlags );
     aHd.SeekToEndOfRecord( rIn );
@@ -456,7 +459,8 @@ class PptFontCollection : public std::vector<std::unique_ptr<PptFontEntityAtom>>
 
 SvStream& ReadPptUserEditAtom( SvStream& rIn, PptUserEditAtom& rAtom )
 {
-    ReadDffRecordHeader( rIn, rAtom.aHd )
+    ReadDffRecordHeader( rIn, rAtom.aHd );
+    rIn
        .ReadInt32( rAtom.nLastSlideID )
        .ReadUInt32( rAtom.nVersion )
        .ReadUInt32( rAtom.nOffsetLastEdit )
diff --git a/include/filter/msfilter/dffrecordheader.hxx b/include/filter/msfilter/dffrecordheader.hxx
index a365217..e5c5121 100644
--- a/include/filter/msfilter/dffrecordheader.hxx
+++ b/include/filter/msfilter/dffrecordheader.hxx
@@ -56,7 +56,7 @@ public:
         return nFilePos == rIn.Seek(nFilePos);
     }
 
-    MSFILTER_DLLPUBLIC friend SvStream& ReadDffRecordHeader(SvStream& rIn, DffRecordHeader& rRec);
+    MSFILTER_DLLPUBLIC friend bool ReadDffRecordHeader(SvStream& rIn, DffRecordHeader& rRec);
 };
 
 #endif


More information about the Libreoffice-commits mailing list