diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-04-12 21:44:18 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-04-12 21:44:18 -0400 |
commit | 1080a7ca10bcb5ad51ec381963d95d2884c55a18 (patch) | |
tree | 3491c6bf61649f79664ae8c5adc65d1acb45ea11 /pango/itemize.c | |
parent | 99c3da037458870d776a6d02fee07f323c3ef76e (diff) | |
download | pango-1080a7ca10bcb5ad51ec381963d95d2884c55a18.tar.gz |
itemize: Be more defensivenull-fonts
Let them have their NULL fonts.
Produce hexboxes without criticals.
Diffstat (limited to 'pango/itemize.c')
-rw-r--r-- | pango/itemize.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pango/itemize.c b/pango/itemize.c index 01399b7e..728ad7d9 100644 --- a/pango/itemize.c +++ b/pango/itemize.c @@ -1164,6 +1164,9 @@ apply_scale_to_item (PangoContext *context, PangoFontDescription *desc; double size; + if (!item->analysis.font) + return; + if (is_small_caps) pango_analysis_set_size_font (&item->analysis, item->analysis.font); @@ -1294,11 +1297,14 @@ static PangoVariant get_font_variant (PangoItem *item) { PangoFontDescription *desc; - PangoVariant variant; + PangoVariant variant = PANGO_VARIANT_NORMAL; - desc = pango_font_describe (item->analysis.font); - variant = pango_font_description_get_variant (desc); - pango_font_description_free (desc); + if (item->analysis.font) + { + desc = pango_font_describe (item->analysis.font); + variant = pango_font_description_get_variant (desc); + pango_font_description_free (desc); + } return variant; } |