Check more of the stream when looking for commands after inline image (issue 19494)
Currently we only check `followingBytes`, which turns out to be too short to find e.g. valid transform (cm) commands with decimal arguments.
This commit is contained in:
parent
92ff26e4ff
commit
65df1d336f
@ -248,8 +248,12 @@ class Parser {
|
|||||||
}
|
}
|
||||||
// Check that the "EI" sequence isn't part of the image data, since
|
// Check that the "EI" sequence isn't part of the image data, since
|
||||||
// that would cause the image to be truncated (fixes issue11124.pdf).
|
// 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(
|
const tmpLexer = new Lexer(
|
||||||
new Stream(followingBytes.slice()),
|
new Stream(stream.peekBytes(5 * n)),
|
||||||
knownCommands
|
knownCommands
|
||||||
);
|
);
|
||||||
// Reduce the number of (potential) warning messages.
|
// Reduce the number of (potential) warning messages.
|
||||||
|
|||||||
1
test/pdfs/issue19494.pdf.link
Normal file
1
test/pdfs/issue19494.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/user-attachments/files/18810079/VERAPDF-1335-InlineImage.pdf
|
||||||
@ -5617,6 +5617,15 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "issue19494",
|
||||||
|
"file": "pdfs/issue19494.pdf",
|
||||||
|
"md5": "2ec2ccbe6aa7e622ef981ca5ca443d55",
|
||||||
|
"link": true,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"lastPage": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "issue11768",
|
"id": "issue11768",
|
||||||
"file": "pdfs/issue11768_reduced.pdf",
|
"file": "pdfs/issue11768_reduced.pdf",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user