[name] Fix cmp for invalid language

This commit is contained in:
Behdad Esfahbod 2018-10-23 22:19:09 -07:00
parent 888a65615c
commit 68f172101c
1 changed files with 3 additions and 0 deletions

View File

@ -120,6 +120,9 @@ _hb_ot_name_entry_cmp_key (const void *pa, const void *pb)
if (a->name_id != b->name_id)
return a->name_id < b->name_id ? -1 : +1;
if (a->language == b->language) return 0;
if (!a->language) return -1;
if (!b->language) return +1;
return strcmp (hb_language_to_string (a->language),
hb_language_to_string (b->language));
}