summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--pango/pango-context.c2
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c90d825..93467224 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-03-01 Tor Lillqvist <tml@novell.com>
+
+ * pango/pango-context.c (update_metrics_from_items): Check the
+ font pointer being NULL to avoid crashes for at least one class of
+ "bad" fonts (those without a Unicode cmap) on Win32. It would
+ probably be better to prune out such fonts already in the
+ enumeration phase. That would require opening (CreateFontIndirect)
+ every font, though, to be able to check with GetFontData() whether
+ there is a Unicode cmap. Don't know how much that would slow down
+ the enumeration.
+
2006-02-28 Tor Lillqvist <tml@novell.com>
* pango/pangowin32-private.h (PING)
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 49db52a9..0e3fb1e5 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -1310,7 +1310,7 @@ update_metrics_from_items (PangoFontMetrics *metrics,
PangoItem *item = l->data;
PangoFont *font = item->analysis.font;
- if (g_hash_table_lookup (fonts_seen, font) == NULL)
+ if (font != NULL && g_hash_table_lookup (fonts_seen, font) == NULL)
{
PangoFontMetrics *raw_metrics = pango_font_get_metrics (font, language);
g_hash_table_insert (fonts_seen, font, font);