From b758881a58e079ab63e04f9a2e97523e2f593602 Mon Sep 17 00:00:00 2001 From: handa Date: Wed, 7 Jul 2004 13:12:28 +0000 Subject: [PATCH] (lookup_gsub): For LookupType 5 Subformat 2, if ClassSet is not defined, do nothing. --- src/otfdrive.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/otfdrive.c b/src/otfdrive.c index ff1245e..fd4bab0 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -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 */ { -- 1.7.10.4