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

PDF-Hul: Bug in skipIISBytes and PdfModule.getObject #151

Closed
wants to merge 8 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# Ignore IntelliJ files
.idea
*.iml
**/*.iml

# Ignore Maven artefacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2426,7 +2426,10 @@ protected PdfObject getObject (int objIndex, int recGuard)
}
}
/* And finally extract the object from the object stream. */
return ostrm.getObject (objIndex);
/* Need to ensure the object number is set */
PdfObject obj = ostrm.getObject (objIndex);
obj.setObjNumber (objIndex);
Copy link
Member

@david-russo david-russo Nov 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the object number can be safely moved into the ObjectStream.getObject() method for the benefit of any other callers.

return obj;
}
catch (Exception e) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private long skipIISBytes (long n) throws IOException {
return -1;
}
if (iisBufLen - iisBufOff < n) {
n = iisBufLen + iisBufOff;
n = iisBufLen - iisBufOff;
}
iisBufOff += n;
return n;
Expand Down
Binary file not shown.
Binary file not shown.