mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00: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();
|
auto dict = parse_dict();
|
||||||
if (!dict)
|
if (!dict)
|
||||||
return {};
|
return {};
|
||||||
if (m_reader.matches("stream\n"))
|
if (m_reader.matches("stream"))
|
||||||
return parse_stream(dict.release_nonnull());
|
return parse_stream(dict.release_nonnull());
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
@ -371,6 +371,9 @@ RefPtr<IndirectValue> Parser::parse_indirect_value(int index, int generation)
|
||||||
if (!m_reader.matches("endobj"))
|
if (!m_reader.matches("endobj"))
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
consume(6);
|
||||||
|
consume_whitespace();
|
||||||
|
|
||||||
return make_object<IndirectValue>(index, generation, value);
|
return make_object<IndirectValue>(index, generation, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue