From 7148dc1a978610af25b4f490691a62d709c8c463 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 2 Apr 2013 14:08:53 -0400 Subject: [PATCH] [graphite2] Don't crash if language is not set https://bugs.webkit.org/show_bug.cgi?id=113796 --- src/hb-graphite2.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index 16ef9a4da..cce860694 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -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);