Kaydet (Commit) 1847753a authored tarafından Caolán McNamara's avatar Caolán McNamara

check seeks and reads

Change-Id: I0c5c4784713376e0762bfbd197640f8d31b65562
üst 894151e8
......@@ -786,7 +786,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
break;
}
aClientDataHd.SeekToEndOfRecord( rSt );
if (!aClientDataHd.SeekToEndOfRecord(rSt))
break;
}
}
if ( ( aPlaceholderAtom.nPlaceholderId == PptPlaceholder::NOTESSLIDEIMAGE ) && !rPersistEntry.bNotesMaster )
......@@ -1810,7 +1811,10 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
break;
}
else
aPlaceHd.SeekToEndOfRecord( rStCtrl );
{
if (!aPlaceHd.SeekToEndOfRecord(rStCtrl))
break;
}
}
}
......@@ -2402,7 +2406,8 @@ bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStream&
}
}
}
aProgTagBinaryDataHd.SeekToEndOfRecord( rSt );
if (!aProgTagBinaryDataHd.SeekToEndOfRecord(rSt))
break;
}
}
if ( !bRetValue )
......@@ -2703,7 +2708,8 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage,
}
break;
}
aCommentHd.SeekToEndOfRecord( rStCtrl );
if (!aCommentHd.SeekToEndOfRecord(rStCtrl))
break;
}
Point aPosition( nPosX, nPosY );
rMan.Scale( aPosition );
......@@ -2763,7 +2769,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) )
{
ImportComment10( *this, rStCtrl, pRet, aComment10Hd );
aComment10Hd.SeekToEndOfRecord( rStCtrl );
if (!aComment10Hd.SeekToEndOfRecord(rStCtrl))
break;
}
}
}
......@@ -2841,7 +2848,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
break;
aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
if (!aEscherObjListHd.SeekToEndOfRecord(rStCtrl))
break;
}
// now importing page
......@@ -2891,7 +2899,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
if ( aEscherObjListHd.nRecType == DFF_msofbtSpgrContainer )
break;
aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
if (!aEscherObjListHd.SeekToEndOfRecord(rStCtrl))
break;
}
if ( rSlidePersist.pBObj )
......@@ -2907,7 +2916,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
break;
}
aHd.SeekToEndOfRecord( rStCtrl );
if (!aHd.SeekToEndOfRecord(rStCtrl))
break;
}
if ( rSlidePersist.pSolverContainer )
SolveSolver( *rSlidePersist.pSolverContainer );
......@@ -3116,7 +3126,8 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderF
}
break;
}
aHd.SeekToEndOfRecord( rStCtrl );
if (!aHd.SeekToEndOfRecord(rStCtrl))
break;
}
}
......@@ -3246,7 +3257,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
#ifdef DBG_UTIL
else OSL_FAIL( "PPTExParaProv::PPTExParaProv - unknown atom interpreting the PPT_PST_ExtendedBuGraContainer (SJ)" );
#endif
aBuGraAtomHd.SeekToEndOfRecord( rSt );
if (!aBuGraAtomHd.SeekToEndOfRecord(rSt))
break;
}
if ( !aBuGraList.empty() )
bGraphics = true;
......@@ -3270,7 +3282,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
break;
#endif
}
aHd.SeekToEndOfRecord( rSt );
if (!aHd.SeekToEndOfRecord(rSt))
break;
}
}
......@@ -3319,7 +3332,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
case 0xf144 :
break;
}
aHd.SeekToEndOfRecord( rSt );
if (!aHd.SeekToEndOfRecord(rSt))
break;
}
}
rSt.Seek( nOldPos );
......@@ -4096,7 +4110,10 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
break;
}
else
aTxMasterStyleHd.SeekToEndOfRecord( rIn );
{
if (!aTxMasterStyleHd.SeekToEndOfRecord(rIn))
break;
}
}
}
......@@ -4110,7 +4127,10 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
if ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom )
break;
else
aTxMasterStyleHd.SeekToEndOfRecord( rIn );
{
if (!aTxMasterStyleHd.SeekToEndOfRecord(rIn))
break;
}
}
while ( ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom ) && ( rIn.Tell() < nEndRecPos ) ) //TODO: aTxMasterStyleHd may be used without having been properly initialized
{
......@@ -4212,7 +4232,8 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
}
#endif
}
aTxMasterStyleHd.SeekToEndOfRecord( rIn );
if (!aTxMasterStyleHd.SeekToEndOfRecord(rIn))
break;
ReadDffRecordHeader( rIn, aTxMasterStyleHd );
}
if ( !mpCharSheet[ TSS_TYPE_SUBTITLE ] )
......@@ -4285,7 +4306,10 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
break;
}
else
aTxMasterStyleHd2.SeekToEndOfRecord( rIn );
{
if (!aTxMasterStyleHd2.SeekToEndOfRecord(rIn))
break;
}
}
}
}
......@@ -6480,7 +6504,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( ( nTmpSlideId == nSlideId ) && ( pHd->nRecInstance == nRefNum ) )
{
pHd->SeekToEndOfRecord( rIn );
if (!pHd->SeekToEndOfRecord(rIn))
break;
ReadDffRecordHeader( rIn, aPresRuleHd );
if ( aPresRuleHd.nRecType == PPT_PST_ExtendedParagraphAtom )
{
......@@ -6810,7 +6835,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
break;
}
aTextHd.SeekToEndOfRecord( rIn );
if (!aTextHd.SeekToEndOfRecord(rIn))
break;
if ( pEntry )
{
// sorting fields ( hi >> lo )
......
......@@ -521,7 +521,8 @@ bool ImplSdPPTImport::Import()
break;
rStCtrl.SeekRel( 8 );
rStCtrl.ReadUInt32( pPtr->nIndex );
aHyperE.SeekToEndOfRecord( rStCtrl );
if (!aHyperE.SeekToEndOfRecord(rStCtrl))
break;
}
}
}
......@@ -826,7 +827,8 @@ bool ImplSdPPTImport::Import()
}
break;
}
aProgTagContentHd.SeekToEndOfRecord( rStCtrl );
if (!aProgTagContentHd.SeekToEndOfRecord(rStCtrl))
break;
}
}
}
......@@ -953,7 +955,8 @@ bool ImplSdPPTImport::Import()
case PPT_PST_SlideTime10Atom : // ??? don't know, this atom is always 8 bytes big
break; // and is appearing in nearly every l10 progtag
}
aProgTagContentHd.SeekToEndOfRecord( rStCtrl );
if (!aProgTagContentHd.SeekToEndOfRecord(rStCtrl))
break;
}
}
}
......@@ -965,7 +968,8 @@ bool ImplSdPPTImport::Import()
break;
}
aHd.SeekToEndOfRecord( rStCtrl );
if (!aHd.SeekToEndOfRecord(rStCtrl))
break;
}
ImportPageEffect( pPage, bNewAnimationsUsed );
}
......@@ -1786,7 +1790,8 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations
}
}
}
aHd.SeekToEndOfRecord( rStCtrl );
if (!aHd.SeekToEndOfRecord(rStCtrl))
break;
}
if ( bTryTwice && !bSSSlideInfoAtom )
{
......@@ -1948,7 +1953,10 @@ OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
}
}
if ( !bDone )
aSoundRecHd.SeekToEndOfRecord( rStCtrl );
{
if (!aSoundRecHd.SeekToEndOfRecord(rStCtrl))
break;
}
}
}
}
......@@ -2009,7 +2017,8 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
}
break;
}
aHd.SeekToEndOfRecord( rStCtrl );
if (!aHd.SeekToEndOfRecord(rStCtrl))
break;
}
break;
}
......@@ -2018,7 +2027,8 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
}
break;
}
aHdMovie.SeekToEndOfRecord( rStCtrl );
if (!aHdMovie.SeekToEndOfRecord(rStCtrl))
break;
}
}
return aRetVal;
......@@ -2676,7 +2686,8 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
break;
}
aHd.SeekToEndOfRecord( rSt );
if (!aHd.SeekToEndOfRecord(rSt))
break;
}
while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < nClientDataLen ) );
......
......@@ -319,7 +319,7 @@ bool Section::GetDictionary( Dictionary& rDict )
void Section::Read( SotStorageStream *pStrm )
{
sal_uInt32 i, nSecOfs, nPropSize, nStrmSize;
sal_uInt32 nSecOfs, nPropSize, nStrmSize;
nSecOfs = pStrm->Tell();
pStrm->Seek( STREAM_SEEK_TO_END );
......@@ -357,7 +357,7 @@ void Section::Read( SotStorageStream *pStrm )
bool bVariant = ( nPropType == VT_VARIANT );
for ( i = 0; nPropSize && ( i < nVectorCount ); i++ )
for (sal_uInt32 i = 0; nPropSize && ( i < nVectorCount ); ++i)
{
if ( bVariant )
{
......@@ -453,7 +453,7 @@ void Section::Read( SotStorageStream *pStrm )
if( nPropSize > nSecSize - nSecOfs )
nPropSize = nSecSize - nSecOfs;
sal_uInt8* pBuf = new sal_uInt8[ nPropSize ];
pStrm->Read( pBuf, nPropSize );
nPropSize = pStrm->Read(pBuf, nPropSize);
AddProperty( nPropId, pBuf, nPropSize );
delete[] pBuf;
}
......@@ -488,14 +488,17 @@ void Section::Read( SotStorageStream *pStrm )
}
else
{
sal_uInt32 nDictCount, nSize;
pStrm->ReadUInt32( nDictCount );
for ( i = 0; i < nDictCount; i++ )
sal_uInt32 nDictCount(0);
pStrm->ReadUInt32(nDictCount);
for (sal_uInt32 i = 0; i < nDictCount; ++i)
{
sal_uInt32 nSize(0);
pStrm->ReadUInt32( nSize ).ReadUInt32( nSize );
pStrm->SeekRel( nSize );
sal_uInt64 nPos = pStrm->Tell() + nSize;
if (nPos != pStrm->Seek(nPos))
break;
}
nSize = pStrm->Tell();
sal_uInt32 nSize = pStrm->Tell();
pStrm->Seek( nPropOfs + nSecOfs );
nSize -= pStrm->Tell();
if ( nSize > nStrmSize )
......@@ -504,7 +507,7 @@ void Section::Read( SotStorageStream *pStrm )
break;
}
sal_uInt8* pBuf = new sal_uInt8[ nSize ];
pStrm->Read( pBuf, nSize );
nSize = pStrm->Read(pBuf, nSize);
AddProperty( 0xffffffff, pBuf, nSize );
delete[] pBuf;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment