mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
LibPDF: Don't overflow SIDs in type 1 charset parsing
first_sid has type SID (aka u16), so don't store it in an u8. This fixes (among other things) page 24 on the PDF 1.7 spec.
This commit is contained in:
parent
403d3bbdaf
commit
49275c4b17
1 changed files with 1 additions and 1 deletions
|
@ -631,7 +631,7 @@ PDFErrorOr<Vector<DeprecatedFlyString>> CFF::parse_charset(Reader&& reader, size
|
|||
while (names.size() < glyph_count - 1) {
|
||||
auto first_sid = TRY(reader.try_read<BigEndian<SID>>());
|
||||
int left = TRY(reader.try_read<Card8>());
|
||||
for (u8 sid = first_sid; left >= 0; left--, sid++)
|
||||
for (SID sid = first_sid; left >= 0; left--, sid++)
|
||||
TRY(names.try_append(resolve_sid(sid, strings)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue