[subset] fix heap buffer overflow found by fuzzer.

This commit is contained in:
Garret Rieger 2021-02-12 15:16:59 -08:00 committed by Behdad Esfahbod
parent ae860db893
commit 5ca353a2d0
3 changed files with 3 additions and 0 deletions

View File

@ -2064,6 +2064,9 @@ struct LigatureArray : OffsetListOf<LigatureAttach>
unsigned ligature_count = 0;
for (hb_codepoint_t gid : coverage)
{
if (ligature_count >= this->len)
break;
ligature_count++;
if (!glyphset.has (gid)) continue;