mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2025-12-20 04:10:01 +01:00
src/sfnt/ttload.c (tt_face_load_any): Correctly handle font containers.
Reported as https://issues.oss-fuzz.com/issues/424613326
This commit is contained in:
parent
ba7eb5bed7
commit
d3668e00da
2 changed files with 16 additions and 2 deletions
|
|
@ -579,6 +579,9 @@
|
|||
if ( face_instance_index < 0 && face_index > 0 )
|
||||
face_index--;
|
||||
|
||||
/* Note that `face_index` is also used to enumerate elements */
|
||||
/* of containers like a Mac Resource; this means we must */
|
||||
/* check whether we actually have a TTC. */
|
||||
if ( face_index >= face->ttc_header.count )
|
||||
{
|
||||
if ( face_instance_index >= 0 )
|
||||
|
|
|
|||
|
|
@ -585,8 +585,19 @@
|
|||
}
|
||||
else if ( tag == 1 )
|
||||
{
|
||||
/* The currently selected font's table directory. */
|
||||
offset += face->ttc_header.offsets[face->root.face_index & 0xFFFF];
|
||||
/* The currently selected font's table directory. */
|
||||
/* */
|
||||
/* Note that `face_index` is also used to enumerate elements */
|
||||
/* of containers like a Mac Resource; this means we must */
|
||||
/* check whether we actually have a TTC (with multiple table */
|
||||
/* directories). */
|
||||
FT_Long idx = face->root.face_index & 0xFFFF;
|
||||
|
||||
|
||||
if ( idx >= face->ttc_header.count )
|
||||
idx = 0;
|
||||
|
||||
offset += face->ttc_header.offsets[idx];
|
||||
size = 4 + 8 + 16 * face->num_tables;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue