summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-27 14:22:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-08-27 14:45:03 +0100
commitde71eae5807ff94c8eace0eccaabf1ffa08e77b6 (patch)
tree791d93d4667b04ad754448c4c34dac23f82b8dd0 /sd
parent9a695e071020639926f8b038aba64eb016a1801a (diff)
avoid loops in atom chains
Change-Id: Icc40c0ee6c7d8d305cf7cc60cbf3e511c763aedd
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/ppt/pass/hang-9.pptbin0 -> 7712 bytes
-rw-r--r--sd/source/filter/ppt/pptin.cxx8
2 files changed, 7 insertions, 1 deletions
diff --git a/sd/qa/unit/data/ppt/pass/hang-9.ppt b/sd/qa/unit/data/ppt/pass/hang-9.ppt
new file mode 100644
index 000000000000..97e0158ac9ea
--- /dev/null
+++ b/sd/qa/unit/data/ppt/pass/hang-9.ppt
Binary files differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 8c2d75d04adb..d37855d59f1b 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -733,11 +733,17 @@ bool ImplSdPPTImport::Import()
PptSlidePersistEntry* pE = pPersist;
while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
{
- sal_uInt16 nNextMaster = m_pMasterPages->FindPage( pE->aSlideAtom.nMasterId );
+ auto nOrigMasterId = pE->aSlideAtom.nMasterId;
+ sal_uInt16 nNextMaster = m_pMasterPages->FindPage(nOrigMasterId);
if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
break;
else
pE = &(*pList)[ nNextMaster ];
+ if (pE->aSlideAtom.nMasterId == nOrigMasterId)
+ {
+ SAL_WARN("filter.ms", "loop in atom chain");
+ break;
+ }
}
SdrObject* pObj = ImportPageBackgroundObject( *pMPage, pE->nBackgroundOffset, true ); // import background
if ( pObj )