Skip to content

Commit

Permalink
making the parsing of broken PDFs more robust
Browse files Browse the repository at this point in the history
An extra test to see if a token is numeric before using the value.
  • Loading branch information
samalloing authored Nov 15, 2023
1 parent d745990 commit a704f02
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,10 @@ protected boolean readXRefTables(RepInfo info) throws IOException {
// (Most likely we've hit the keyword "trailer".
break;
}
_objCount = ((Numeric) _parser.getNext()).getIntegerValue();
token = _parser.getNext();
if (token instanceof Numeric) {
_objCount = ((Numeric) token).getIntegerValue();
}
if (_xref == null) {
_xref = new long[_objCount];
}
Expand Down

0 comments on commit a704f02

Please sign in to comment.