1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

When parsing corrupt documents, avoid inserting obviously broken data in the XRef-table (issue 13783)

In cases where even the very *first* attempt at reading from an object will throw, simply ignoring such objects will help improve rendering of *some* corrupt documents.
Note that this will lead to more parsing in some cases, but considering that this only applies to *corrupt* documents that shouldn't be a big deal.
This commit is contained in:
Jonas Jenwald 2021-07-23 17:37:55 +02:00
parent 51f0a81085
commit b82c802dff
5 changed files with 51 additions and 10 deletions

View file

@ -58,6 +58,8 @@ class MissingDataException extends BaseException {
}
}
class ParserEOFException extends BaseException {}
class XRefEntryException extends BaseException {}
class XRefParseException extends BaseException {}
@ -450,6 +452,7 @@ export {
isWhiteSpace,
log2,
MissingDataException,
ParserEOFException,
parseXFAPath,
readInt8,
readUint16,