LibPDF: Tolerate comment after last dict item

Necessary to be able to open
https://github.com/pdf-association/pdf20examples/blob/master/pdf20-utf8-test.pdf
This commit is contained in:
Nico Weber 2023-11-21 21:31:09 -05:00 committed by Sam Atkins
parent 7ca4e4a967
commit 9e8cf4fc1a
Notes: sideshowbarker 2024-07-17 00:23:42 +09:00

View File

@ -425,9 +425,9 @@ PDFErrorOr<NonnullRefPtr<DictObject>> Parser::parse_dict()
HashMap<DeprecatedFlyString, Value> map;
while (!m_reader.done()) {
parse_comment();
if (m_reader.matches(">>"))
break;
parse_comment();
auto name = TRY(parse_name())->name();
auto value = TRY(parse_value());
map.set(name, value);