Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception when Size is not an integer #744

Merged
merged 3 commits into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public class PdfModule extends ModuleBase {
protected Map<Integer, Integer> _pageSeqMap;

protected PdfIndirectObj _docCatDictRef;
protected PdfIndirectObj _encryptDictRef;
protected PdfIndirectObj _encryptDictRef;
protected PdfIndirectObj _docInfoDictRef;
protected PdfIndirectObj _pagesDictRef;

Expand Down Expand Up @@ -1335,9 +1335,13 @@ protected boolean parseTrailer(RepInfo info, boolean prevOnly)
_numObjects = -1;
if (obj instanceof PdfSimpleObject) {
token = ((PdfSimpleObject) obj).getToken();
if (token instanceof Numeric)
if (token instanceof Numeric) {
_numObjects = ((Numeric) token).getIntegerValue();
_xref = new long[_numObjects];
_xref = new long[_numObjects];
} else {
throw new PdfInvalidException(MessageConstants.PDF_HUL_73, // PDF-HUL-73
_parser.getOffset());
}
}
if (_numObjects < 0) {
throw new PdfInvalidException(MessageConstants.PDF_HUL_73, // PDF-HUL-73
Expand Down