From: Kenichi Handa Date: Fri, 17 Oct 2008 02:20:31 +0000 (+0000) Subject: (ftfont_otf_features): Fix indexing X-Git-Tag: emacs-pretest-23.0.90~2434 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=393566216f8622ca3a41ff361cf8db40e1132276;p=emacs.git (ftfont_otf_features): Fix indexing gsub_gpos->FeatureList.Feature. Check the validity of indices. --- diff --git a/src/ChangeLog b/src/ChangeLog index a601b361d5a..6606d09e446 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-10-17 Kenichi Handa + + * ftfont.c (ftfont_otf_features): Fix indexing + gsub_gpos->FeatureList.Feature. Check the validity of indices. + 2008-10-16 Magnus Henoch * dbusbind.c (Fdbus_call_method): Unbreak usage line. diff --git a/src/ftfont.c b/src/ftfont.c index da2760a7891..cc78e29ebbd 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1340,7 +1340,7 @@ ftfont_otf_features (gsub_gpos) 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 @@ ftfont_otf_features (gsub_gpos) 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)