Tolerate unsorted OT table entries for small number of entries
See comment. Fixes https://github.com/harfbuzz/harfbuzz/issues/3065
This commit is contained in:
parent
03cd9c5cba
commit
ba6db26b65
|
@ -102,7 +102,13 @@ typedef struct OpenTypeOffsetTable
|
||||||
{
|
{
|
||||||
Tag t;
|
Tag t;
|
||||||
t = tag;
|
t = tag;
|
||||||
return tables.bfind (t, table_index, HB_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX);
|
/* Use lfind for small fonts; there are fonts that have unsorted table entries;
|
||||||
|
* those tend to work in other tools, so tolerate them.
|
||||||
|
* https://github.com/harfbuzz/harfbuzz/issues/3065 */
|
||||||
|
if (tables.len < 16)
|
||||||
|
return tables.lfind (t, table_index, HB_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX);
|
||||||
|
else
|
||||||
|
return tables.bfind (t, table_index, HB_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX);
|
||||||
}
|
}
|
||||||
const TableRecord& get_table_by_tag (hb_tag_t tag) const
|
const TableRecord& get_table_by_tag (hb_tag_t tag) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue