# HG changeset patch # User Kenichi Handa # Date 1224210013 0 # Node ID 22ff4ff011f4f3c8777de69db13a0397946ac962 # Parent 5af028ab01369bc85ea30241bec5d285bd103451 (ftfont_otf_features): Fix indexing gsub_gpos->FeatureList.Feature. Check the validity of indices. diff -r 5af028ab0136 -r 22ff4ff011f4 src/ftfont.c --- a/src/ftfont.c Thu Oct 16 20:06:38 2008 +0000 +++ b/src/ftfont.c Fri Oct 17 02:20:13 2008 +0000 @@ -1340,7 +1340,7 @@ OTF_GSUB_GPOS *gsub_gpos; { Lisp_Object scripts, langsyses, features, sym; - int i, j, k; + int i, j, k, l; for (scripts = Qnil, i = gsub_gpos->ScriptList.ScriptCount - 1; i >= 0; i--) { @@ -1359,7 +1359,10 @@ for (features = Qnil, k = otf_langsys->FeatureCount - 1; k >= 0; k--) { - OTF_TAG_SYM (sym, gsub_gpos->FeatureList.Feature[k].FeatureTag); + l = otf_langsys->FeatureIndex[k]; + if (l > gsub_gpos->FeatureList.FeatureCount) + continue; + OTF_TAG_SYM (sym, gsub_gpos->FeatureList.Feature[l].FeatureTag); features = Fcons (sym, features); } if (j >= 0)