summaryrefslogtreecommitdiff
path: root/pango/pango-language.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-09-08 16:49:43 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-09-08 16:53:37 -0400
commit7db68865b7560ca5d74aa6cd15656b3656ea7f42 (patch)
tree6d34692fdda54a66d9282fa855d6fcd0f5310a2b /pango/pango-language.c
parent677db04fae0af875685a71e0cedd408578071bef (diff)
downloadpango-7db68865b7560ca5d74aa6cd15656b3656ea7f42.tar.gz
Don't assert in pango_language_get_scriptsavoid-script-lang-crash
The assertion in pango_language_get_scripts can actually be triggered since we last regenerated the pango_script_for_lang table. It now includes an entry for und-zsye which has no scripts. Handle this case without asserting. This commit includes a test.
Diffstat (limited to 'pango/pango-language.c')
-rw-r--r--pango/pango-language.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pango/pango-language.c b/pango/pango-language.c
index 575d4652..bb5ed470 100644
--- a/pango/pango-language.c
+++ b/pango/pango-language.c
@@ -662,7 +662,7 @@ pango_language_get_scripts (PangoLanguage *language,
script_for_lang,
pango_script_for_lang);
- if (!script_for_lang)
+ if (!script_for_lang || script_for_lang->scripts[0] == 0)
{
if (num_scripts)
*num_scripts = 0;