mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-27 01:50:24 +00:00
LibPDF: Allow newlines between xref table and "trailer" keyword
This commit is contained in:
parent
4d509ff365
commit
6133acb8c0
Notes:
sideshowbarker
2024-07-17 17:50:29 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/6133acb8c0 Pull-request: https://github.com/SerenityOS/serenity/pull/12920
1 changed files with 7 additions and 2 deletions
|
@ -303,7 +303,7 @@ PDFErrorOr<NonnullRefPtr<XRefTable>> Parser::parse_xref_table()
|
|||
|
||||
auto table = adopt_ref(*new XRefTable());
|
||||
|
||||
while (true) {
|
||||
do {
|
||||
if (m_reader.matches("trailer"))
|
||||
return table;
|
||||
|
||||
|
@ -349,11 +349,16 @@ PDFErrorOr<NonnullRefPtr<XRefTable>> Parser::parse_xref_table()
|
|||
}
|
||||
|
||||
table->add_section({ starting_index, object_count, entries });
|
||||
}
|
||||
} while (matches_number());
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
PDFErrorOr<NonnullRefPtr<DictObject>> Parser::parse_file_trailer()
|
||||
{
|
||||
while (matches_eol())
|
||||
consume_eol();
|
||||
|
||||
if (!m_reader.matches("trailer"))
|
||||
return error("Expected \"trailer\" keyword");
|
||||
m_reader.move_by(7);
|
||||
|
|
Loading…
Reference in a new issue