summaryrefslogtreecommitdiff
path: root/vcl/source/filter/ipdf/pdfdocument.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/filter/ipdf/pdfdocument.cxx')
-rw-r--r--vcl/source/filter/ipdf/pdfdocument.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index 83560394ba4c..5661e605bee5 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -2226,9 +2226,14 @@ size_t PDFDictionaryElement::Parse(const std::vector< std::unique_ptr<PDFElement
else if (!pDictionary->alreadyParsing())
{
// Nested dictionary.
- i = PDFDictionaryElement::Parse(rElements, pDictionary, pDictionary->m_aItems);
- rDictionary[aName] = pDictionary;
- aName.clear();
+ const size_t nexti
+ = PDFDictionaryElement::Parse(rElements, pDictionary, pDictionary->m_aItems);
+ if (nexti >= i) // ensure we go forwards and not endlessly loop
+ {
+ i = nexti;
+ rDictionary[aName] = pDictionary;
+ aName.clear();
+ }
}
}