mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
LibPDF: Fix two parser bugs
- A newline was assumed to follow the "stream" keyword, when it can also be a windows-style line break - Fix not consuming the "endobj" at the end of every indirect object
This commit is contained in:
parent
ffda24373a
commit
be1be47613
1 changed files with 4 additions and 1 deletions
|
@ -316,7 +316,7 @@ Value Parser::parse_value()
|
|||
auto dict = parse_dict();
|
||||
if (!dict)
|
||||
return {};
|
||||
if (m_reader.matches("stream\n"))
|
||||
if (m_reader.matches("stream"))
|
||||
return parse_stream(dict.release_nonnull());
|
||||
return dict;
|
||||
}
|
||||
|
@ -371,6 +371,9 @@ RefPtr<IndirectValue> Parser::parse_indirect_value(int index, int generation)
|
|||
if (!m_reader.matches("endobj"))
|
||||
return {};
|
||||
|
||||
consume(6);
|
||||
consume_whitespace();
|
||||
|
||||
return make_object<IndirectValue>(index, generation, value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue