Change the assert
in Parser.findDefaultInlineStreamEnd
to a non-PRODUCTION one
Given that this `assert` is only intended to catch any implementation bugs in our code, and not actually to validate the PDF data directly[1], we can avoid making this function call unconditionally. --- [1] In those cases, for example a `FormatError` should have been thrown instead.
This commit is contained in:
parent
2d1b1e7968
commit
d22eb3591e
@ -203,7 +203,12 @@ class Parser {
|
||||
} else if (state === 1) {
|
||||
state = ch === I ? 2 : 0;
|
||||
} else {
|
||||
assert(state === 2, "findDefaultInlineStreamEnd - invalid state.");
|
||||
if (
|
||||
typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || TESTING")
|
||||
) {
|
||||
assert(state === 2, "findDefaultInlineStreamEnd - invalid state.");
|
||||
}
|
||||
if (ch === SPACE || ch === LF || ch === CR) {
|
||||
maybeEIPos = stream.pos;
|
||||
// Let's check that the next `n` bytes are ASCII... just to be sure.
|
||||
|
Loading…
Reference in New Issue
Block a user