diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index 3a4e592eae..4e649ff967 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -519,6 +519,8 @@ PDFErrorOr> Parser::parse_operators() while (!m_reader.done()) { parse_comment(); + if (m_reader.done()) + break; auto ch = m_reader.peek(); if (is_operator_char_start(ch)) { auto operator_start = m_reader.offset();