Merge pull request #15686 from Snuffleupagus/findDefaultInlineStreamEnd-assert

Change the `assert` in `Parser.findDefaultInlineStreamEnd` to a non-PRODUCTION one
This commit is contained in:
Tim van der Meij 2022-11-13 13:20:03 +01:00 committed by GitHub
commit bfe6ff5893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

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

View File

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/9983741/issue2618.pdf

View File

@ -3047,6 +3047,14 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue2618",
"file": "pdfs/issue2618.pdf",
"md5": "2c554a99a52288ca1a44a422eeafb8fb",
"rounds": 1,
"lastPage": 1,
"link": true,
"type": "eq"
},
{ "id": "issue2642",
"file": "pdfs/issue2642.pdf",
"md5": "b6679861fdce3bbab0c1fa51bb7f5077",