File r1929-Extend-cycle-detection-for-XRef-tables-r1920.patch of Package podofo.34526
------------------------------------------------------------------------
r1929 | mc-zyx | 2018-07-01 18:53:56 +0200 (dom, 01 jul 2018) | 2 lines
Extend cycle detection for XRef tables (r1920)
Index: src/base/PdfParser.cpp
===================================================================
--- src/base/PdfParser.cpp (revision 1928)
+++ src/base/PdfParser.cpp (revision 1929)
@@ -591,7 +591,12 @@
m_nIncrementalUpdates++;
try {
- ReadXRefContents( static_cast<pdf_long>(trailer.GetDictionary().GetKeyAsLong( "Prev", 0 )) );
+ pdf_long lOffset = static_cast<pdf_long>(trailer.GetDictionary().GetKeyAsLong( "Prev", 0 ));
+
+ if( m_visitedXRefOffsets.find( lOffset ) == m_visitedXRefOffsets.end() )
+ ReadXRefContents( lOffset );
+ else
+ PdfError::LogMessage( eLogSeverity_Warning, "XRef contents at offset %" PDF_FORMAT_INT64 " requested twice, skipping the second read\n", static_cast<pdf_int64>( lOffset ));
} catch( PdfError & e ) {
e.AddToCallstack( __FILE__, __LINE__, "Unable to load /Prev xref entries." );
throw e;
------------------------------------------------------------------------