[graphite2] Don't crash if language is not set

https://bugs.webkit.org/show_bug.cgi?id=113796
This commit is contained in:
Behdad Esfahbod 2013-04-02 14:08:53 -04:00
parent a88a62f70f
commit 7148dc1a97
1 changed files with 1 additions and 1 deletions

View File

@ -226,7 +226,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
gr_font *grfont = HB_SHAPER_DATA_GET (font);
const char *lang = hb_language_to_string (hb_buffer_get_language (buffer));
const char *lang_end = strchr (lang, '-');
const char *lang_end = lang ? strchr (lang, '-') : NULL;
int lang_len = lang_end ? lang_end - lang : -1;
gr_feature_val *feats = gr_face_featureval_for_lang (grface, lang ? hb_tag_from_string (lang, lang_len) : 0);