(lookup_gsub): For LookupType 5 Subformat 2, if
authorhanda <handa>
Wed, 7 Jul 2004 13:12:28 +0000 (13:12 +0000)
committerhanda <handa>
Wed, 7 Jul 2004 13:12:28 +0000 (13:12 +0000)
ClassSet is not defined, do nothing.

src/otfdrive.c

index ff1245e..fd4bab0 100644 (file)
@@ -493,23 +493,24 @@ lookup_gsub (OTF_LookupList *lookup_list, unsigned lookup_list_index,
 
              class = get_class_def (&context2->ClassDef, g->glyph_id);
              set = context2->ClassSet + class;
-             for (j = 0; j < set->ClassRuleCnt; j++)
-               {
-                 rule = set->ClassRule + j;
-                 if (match_classes (&context2->ClassDef,
-                                    gstring, gidx + 1,
-                                    rule->GlyphCount - 1, rule->Class)
-                     < 0)
-                   continue;
-                 orig_used = gstring->used;
-                 for (k = 0; k < rule->LookupCount; k++)
-                   lookup_gsub (lookup_list,
-                                rule->LookupRecord[k].LookupListIndex,
-                                gstring,
-                                gidx + rule->LookupRecord[k].SequenceIndex);
-                 gidx += rule->GlyphCount + (gstring->used - orig_used);
-                 break;
-               }
+             if (set)
+               for (j = 0; j < set->ClassRuleCnt; j++)
+                 {
+                   rule = set->ClassRule + j;
+                   if (match_classes (&context2->ClassDef,
+                                      gstring, gidx + 1,
+                                      rule->GlyphCount - 1, rule->Class)
+                       < 0)
+                     continue;
+                   orig_used = gstring->used;
+                   for (k = 0; k < rule->LookupCount; k++)
+                     lookup_gsub (lookup_list,
+                                  rule->LookupRecord[k].LookupListIndex,
+                                  gstring,
+                                  gidx + rule->LookupRecord[k].SequenceIndex);
+                   gidx += rule->GlyphCount + (gstring->used - orig_used);
+                   break;
+                 }
            }
          else                  /* subtable->Format == 3 */
            {