From: handa Date: Wed, 16 Jan 2008 05:19:21 +0000 (+0000) Subject: (otf_check_features): Check the return value of X-Git-Tag: REL-0-9-4~6 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5aa871b580abfdf520d08e7581a18d1f16a97dc;p=m17n%2Fm17n-pango.git (otf_check_features): Check the return value of pango_ot_info_find_language. Check info before accessing info->ruleset. --- diff --git a/m17n-fc.c b/m17n-fc.c index c6a24aa..9989d18 100644 --- a/m17n-fc.c +++ b/m17n-fc.c @@ -212,10 +212,14 @@ otf_check_features (PangoOTInfo *ot_info, PangoOTTableType type, langsys_tag = spec->langsys; if (! langsys_tag) langsys_tag = PANGO_OT_DEFAULT_LANGUAGE; - pango_ot_info_find_language (ot_info, type, script_idx, - langsys_tag, &langsys_idx, &index); + if (! pango_ot_info_find_language (ot_info, type, script_idx, + langsys_tag, &langsys_idx, &index)) + { + langsys_idx = PANGO_OT_DEFAULT_LANGUAGE; + index = 0xFFFF; + } - if (index != 0xFFFF) + if (info && index != 0xFFFF) { info->ruleset[for_gpos] = pango_ot_ruleset_new (ot_info); pango_ot_ruleset_add_feature (info->ruleset[for_gpos], type,