diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index 00a428e7eb..73a50f82dd 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -520,17 +520,20 @@ PDFErrorOr> Parser::parse_operators() Vector operators; Vector operator_args; - constexpr static auto is_operator_char = [](char ch) { + constexpr static auto is_operator_char_start = [](char ch) { return isalpha(ch) || ch == '*' || ch == '\'' || ch == '"'; }; + constexpr static auto is_operator_char_continuation = [](char ch) { + return is_operator_char_start(ch) || ch == '0' || ch == '1'; + }; m_reader.consume_whitespace(); while (!m_reader.done()) { auto ch = m_reader.peek(); - if (is_operator_char(ch)) { + if (is_operator_char_start(ch)) { auto operator_start = m_reader.offset(); - while (is_operator_char(ch)) { + while (is_operator_char_continuation(ch)) { m_reader.consume(); if (m_reader.done()) break;