1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Relax the /Pages dictionary /Count check for corrupt documents (issue 9105)

After PR 14311, and follow-up patches, we no longer require that the /Count entry (in the /Pages dictionary) is either present or even valid in order to parse/render a PDF document.
Hence it seems strange to keep this requirement for *corrupt* PDF documents, when trying to find a usable `trailer` in the `XRef.indexObjects` method.
This commit is contained in:
Jonas Jenwald 2022-10-19 12:28:25 +02:00
parent 782d098baf
commit bc13a277ce
4 changed files with 22 additions and 4 deletions

View file

@ -591,10 +591,6 @@ class XRef {
if (!(pagesDict instanceof Dict)) {
continue;
}
const pagesCount = pagesDict.get("Count");
if (!Number.isInteger(pagesCount)) {
continue;
}
// The top-level /Pages dictionary isn't obviously corrupt.
} catch (ex) {
trailerError = ex;