diff --git a/src/core/parser.js b/src/core/parser.js index 92816879e..118c42633 100644 --- a/src/core/parser.js +++ b/src/core/parser.js @@ -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.