Files
pdf.js/test/pdfs/bug1898053_minimal.pdf
Calixte Denizet c5c7699615 Auto-close the marked content sections left open in a text object (bug 1898053)
Some PDFs open a marked content section inside a text object and never
close it. Each section adds a nesting level in the text layer, so the DOM
becomes deep enough to crash Chromium with a stack overflow.

When extracting the text, the sections opened after the matching BT are
now closed on ET. The marked content level is tracked per stream in both
getTextContent and getOperatorList: the sections a stream left open are
closed when it ends, and an unbalanced EMC is ignored.
2026-08-18 15:38:44 +02:00

741 B