1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

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

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);