mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:57:44 +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
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…
Add table
Add a link
Reference in a new issue