mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-17 23:07:41 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/49275c4b17 Pull-request: https://github.com/SerenityOS/serenity/pull/21452 Reviewed-by: https://github.com/gmta ✅
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…
Reference in a new issue