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

Check more of the stream when looking for commands after inline image (issue 19494) #19495

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion src/core/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,12 @@ class Parser {
}
// Check that the "EI" sequence isn't part of the image data, since
// that would cause the image to be truncated (fixes issue11124.pdf).
//
// Check more than the `followingBytes` to be able to find operators
// with multiple arguments, e.g. transform (cm) with decimal arguments
// (fixes issue19494.pdf).
const tmpLexer = new Lexer(
new Stream(followingBytes.slice()),
new Stream(stream.peekBytes(5 * n)),
knownCommands
);
// Reduce the number of (potential) warning messages.
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue19494.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/user-attachments/files/18810079/VERAPDF-1335-InlineImage.pdf
9 changes: 9 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5617,6 +5617,15 @@
"rounds": 1,
"type": "eq"
},
{
"id": "issue19494",
"file": "pdfs/issue19494.pdf",
"md5": "2ec2ccbe6aa7e622ef981ca5ca443d55",
"link": true,
"rounds": 1,
"type": "eq",
"lastPage": 1
},
{
"id": "issue11768",
"file": "pdfs/issue11768_reduced.pdf",
Expand Down