In fcfreetype.c, `GetScriptTags`: fix `use_of_uninitialized_value` and return the correct number of parsed tags in case the font file contains less tags than indicated.

This commit is contained in:
Vitaly Lysenkov 2023-02-21 20:13:23 +00:00
parent 06929a556f
commit 89af138176
1 changed files with 2 additions and 2 deletions

View File

@ -2762,9 +2762,9 @@ GetScriptTags(FT_Face face, FT_ULong tabletag, FT_ULong **stags)
goto Fail;
/* sort the tag list before returning it */
qsort(*stags, script_count, sizeof(FT_ULong), compareulong);
qsort(*stags, p, sizeof(FT_ULong), compareulong);
return script_count;
return p;
Fail:
free(*stags);