Skip to content

Avoid cycles in PDF parsing

Marek Kasik requested to merge mkasik/poppler:avoid-cycles-in-pdf-parsing into master

This merge request fixes the issue when a corrupted PDF has an object which refers to on object higher in the stack. If e.g. "/Length" references "/Page" object in which it is used. This can create a cycle which we have to break.

It tries to achieve this by marking objects being processed in Parser::makeStream() as being processed and checking the mark when entering this method again. If the object is marked as already being parsed then return "nullptr" as a stream.

The mark is set as a flag in XRefEntry's flags (XRef object is common to all Parser objects so I chose it).

Merge request reports