summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Lysenkov <vlysenkov@google.com>2023-02-21 20:13:23 +0000
committerVitaly Lysenkov <vlysenkov@google.com>2023-02-21 20:13:23 +0000
commit89af138176855891d8cf3582253e511e5705c3be (patch)
treec00acdda313ab5c1fcedc2ee2166038c6ddaae24
parent06929a556fdc39c8fe12965b69070c8df520a33e (diff)
downloadfontconfig-89af138176855891d8cf3582253e511e5705c3be.tar.gz
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.
-rw-r--r--src/fcfreetype.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index cf923f2..8ae88bd 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -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);