mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-30 11:30:26 +00:00
LibGfx: Fix off-by-one in opentype cmap format 6 parsing
Fixes asserts when rendering 0000037.pdf, 0000116.pdf, 0000463.pdf, 0000483.pdf, 0000506.pdf, and 0000938.pdf in 0000.zip from the pdfa dataset.
This commit is contained in:
parent
2ef24e883c
commit
88bd7d83ad
Notes:
sideshowbarker
2024-07-17 02:38:39 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/88bd7d83ad Pull-request: https://github.com/SerenityOS/serenity/pull/21603
1 changed files with 1 additions and 1 deletions
|
@ -144,7 +144,7 @@ u32 Cmap::Subtable::glyph_id_for_code_point_table_6(u32 code_point) const
|
|||
|
||||
u32 entry_count = be_u16(m_slice.offset((u32)Table6Offsets::EntryCount));
|
||||
u32 code_offset = code_point - first_code;
|
||||
if (code_offset > entry_count)
|
||||
if (code_offset >= entry_count)
|
||||
return 0;
|
||||
|
||||
return be_u16(m_slice.offset((u32)Table6Offsets::GlyphIdArray + code_offset * 2));
|
||||
|
|
Loading…
Reference in a new issue