]> git.eshelyaron.com Git - emacs.git/commitdiff
(ftfont_otf_features): Fix indexing
authorKenichi Handa <handa@m17n.org>
Fri, 17 Oct 2008 02:20:31 +0000 (02:20 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 17 Oct 2008 02:20:31 +0000 (02:20 +0000)
gsub_gpos->FeatureList.Feature.  Check the validity of indices.

src/ChangeLog
src/ftfont.c

index a601b361d5aa3f854cdf6cb63cd54ac5483d8e95..6606d09e446630721f2018709fa5c04f38e9c70d 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-17  Kenichi Handa  <handa@m17n.org>
+
+       * ftfont.c (ftfont_otf_features): Fix indexing
+       gsub_gpos->FeatureList.Feature.  Check the validity of indices.
+
 2008-10-16  Magnus Henoch  <mange@freemail.hu>
 
        * dbusbind.c (Fdbus_call_method): Unbreak usage line.
index da2760a78919b308d101596388b6c5e22d405d63..cc78e29ebbdbd78d736e96fea5a052d018539975 100644 (file)
@@ -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)