summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-27 09:13:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-08-27 09:16:24 +0100
commitc249f93d96ec87b0acbd25ffe087543d6fe9fb14 (patch)
tree990908178026b65715b2570a6845a9e4b9ccfb08 /sd
parent496ee4fcbe697552622901dfb72775d07496bdb0 (diff)
extend seek, loop ending tests to ppt specific code
Change-Id: Id4419b6b902b742117e248870b6a663c9c58955f
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/ppt/pass/hang-3.pptbin0 -> 7680 bytes
-rw-r--r--sd/source/filter/ppt/pptin.cxx35
2 files changed, 21 insertions, 14 deletions
diff --git a/sd/qa/unit/data/ppt/pass/hang-3.ppt b/sd/qa/unit/data/ppt/pass/hang-3.ppt
new file mode 100644
index 000000000000..156a9d0e5052
--- /dev/null
+++ b/sd/qa/unit/data/ppt/pass/hang-3.ppt
Binary files differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 5f92ae82aa10..abc8fc3ebfaa 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -749,7 +749,8 @@ bool ImplSdPPTImport::Import()
DffRecordHeader aPageHd;
if ( SeekToAktPage( &aPageHd ) )
{
- while( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPageHd.GetRecEndFilePos() ) )
+ auto nEndRecPos = SanitizeEndPos(rStCtrl, aPageHd.GetRecEndFilePos());
+ while( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nEndRecPos ) )
{
DffRecordHeader aHd;
ReadDffRecordHeader( rStCtrl, aHd );
@@ -770,7 +771,8 @@ bool ImplSdPPTImport::Import()
if ( SeekToRec( rStCtrl, DFF_msofbtSpgrContainer, nEscherF002End, &aEscherObjListHd ) )
{
sal_uInt32 nObjCount = 0;
- while( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aEscherObjListHd.GetRecEndFilePos() ) )
+ auto nListEndRecPos = SanitizeEndPos(rStCtrl, aEscherObjListHd.GetRecEndFilePos());
+ while( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nListEndRecPos ) )
{
DffRecordHeader aHd2;
ReadDffRecordHeader( rStCtrl, aHd2 );
@@ -801,7 +803,8 @@ bool ImplSdPPTImport::Import()
DffRecordHeader aProgTagHd;
if ( SeekToContentOfProgTag( 10, rStCtrl, aPageHd, aProgTagHd ) )
{
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aProgTagHd.GetRecEndFilePos() ) )
+ auto nTagEndRecPos = SanitizeEndPos(rStCtrl, aProgTagHd.GetRecEndFilePos());
+ while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nTagEndRecPos ) )
{
DffRecordHeader aProgTagContentHd;
ReadDffRecordHeader( rStCtrl, aProgTagContentHd );
@@ -909,7 +912,8 @@ bool ImplSdPPTImport::Import()
bool bNewAnimationsUsed = false;
aPageHd.SeekToContent( rStCtrl );
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPageHd.GetRecEndFilePos() ) )
+ auto nEndRecPos = SanitizeEndPos(rStCtrl, aPageHd.GetRecEndFilePos());
+ while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nEndRecPos ) )
{
DffRecordHeader aHd;
ReadDffRecordHeader( rStCtrl, aHd );
@@ -920,7 +924,8 @@ bool ImplSdPPTImport::Import()
DffRecordHeader aProgTagHd;
if ( SeekToContentOfProgTag( 10, rStCtrl, aPageHd, aProgTagHd ) )
{
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aProgTagHd.GetRecEndFilePos() ) )
+ auto nHdEndRecPos = SanitizeEndPos(rStCtrl, aProgTagHd.GetRecEndFilePos());
+ while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nHdEndRecPos ) )
{
DffRecordHeader aProgTagContentHd;
ReadDffRecordHeader( rStCtrl, aProgTagContentHd );
@@ -1494,7 +1499,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations
DffRecordHeader aPageRecHd;
if ( SeekToAktPage( &aPageRecHd ) )
{
- sal_uLong nPageRecEnd = aPageRecHd.GetRecEndFilePos();
+ sal_uLong nPageRecEnd = SanitizeEndPos(rStCtrl, aPageRecHd.GetRecEndFilePos());
bool bTryTwice = ( eAktPageKind == PPT_SLIDEPAGE );
bool bSSSlideInfoAtom = false;
@@ -1787,12 +1792,12 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations
assert( !pPageList->is_null( nMasterNum ) );
const PptSlidePersistEntry& rE = (*pPageList)[ nMasterNum ];
sal_uInt32 nOfs = rE.aPersistAtom.nReserved;
- if ( nOfs )
- {
- rStCtrl.Seek( nOfs );
- nPageRecEnd = nOfs + 16;
- continue;
- }
+ if ( nOfs )
+ {
+ rStCtrl.Seek( nOfs );
+ nPageRecEnd = nOfs + 16;
+ continue;
+ }
}
}
@@ -1951,7 +1956,8 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
if ( pHd )
{
pHd->SeekToContent( rStCtrl );
- while ( ( rStCtrl.Tell() < pHd->GetRecEndFilePos() ) && aRetVal.isEmpty() )
+ auto nEndRecPos = SanitizeEndPos(rStCtrl, pHd->GetRecEndFilePos());
+ while ( ( rStCtrl.Tell() < nEndRecPos ) && aRetVal.isEmpty() )
{
DffRecordHeader aHdMovie;
ReadDffRecordHeader( rStCtrl, aHdMovie );
@@ -1971,7 +1977,8 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
if ( nRef == nMediaRef )
{
aExVideoHd.SeekToContent( rStCtrl );
- while( rStCtrl.Tell() < aExVideoHd.GetRecEndFilePos() )
+ auto nHdEndRecPos = SanitizeEndPos(rStCtrl, aExVideoHd.GetRecEndFilePos());
+ while (rStCtrl.Tell() < nHdEndRecPos)
{
DffRecordHeader aHd;
ReadDffRecordHeader( rStCtrl, aHd );