From 1e052c424f2aa688ea33f609dff594aced4c2fd7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 25 Jun 2004 14:58:59 +0000 Subject: [PATCH] Avoid a crash if the font doesn't exist. (#144967, Yevgen Muntyan) 2004-06-25 Matthias Clasen * gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid a crash if the font doesn't exist. (#144967, Yevgen Muntyan) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkfontbutton.c | 3 ++- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 018a02d18d..f0281b67c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-06-25 Matthias Clasen + + * gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid + a crash if the font doesn't exist. (#144967, Yevgen Muntyan) + Fri Jun 25 00:32:15 2004 Matthias Clasen * gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 018a02d18d..f0281b67c6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2004-06-25 Matthias Clasen + + * gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid + a crash if the font doesn't exist. (#144967, Yevgen Muntyan) + Fri Jun 25 00:32:15 2004 Matthias Clasen * gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 018a02d18d..f0281b67c6 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2004-06-25 Matthias Clasen + + * gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid + a crash if the font doesn't exist. (#144967, Yevgen Muntyan) + Fri Jun 25 00:32:15 2004 Matthias Clasen * gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 018a02d18d..f0281b67c6 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2004-06-25 Matthias Clasen + + * gtk/gtkfontbutton.c (gtk_font_button_update_font_info): Avoid + a crash if the font doesn't exist. (#144967, Yevgen Muntyan) + Fri Jun 25 00:32:15 2004 Matthias Clasen * gtk/gtktreestore.c (gtk_tree_store_swap): Commit the change diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c index 53eb5cf5a9..34e8c2688c 100644 --- a/gtk/gtkfontbutton.c +++ b/gtk/gtkfontbutton.c @@ -878,9 +878,10 @@ gtk_font_button_update_font_info (GtkFontButton *font_button) gint n_families, n_faces, i; n_families = 0; - n_faces = 0; pango_context_list_families (gtk_widget_get_pango_context (GTK_WIDGET (font_button)), &families, &n_families); + n_faces = 0; + faces = NULL; for (i = 0; i < n_families; i++) { const gchar *name = pango_font_family_get_name (families[i]);