1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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:
Jonas Jenwald 2025-02-15 14:18:07 +01:00
parent 92ff26e4ff
commit 65df1d336f
3 changed files with 15 additions and 1 deletions

View file

@ -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.