From 2377e48038262b371d750fc0e79664536739a266 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 14 Oct 2008 03:47:18 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20555779=20=E2=80=93=20GtkCellRendererPixbu?= =?UTF-8?q?f=20crashed=20on=20failed=20GIcon=20lookup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-10-13 Matthias Clasen Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup * gtk/gtkcellrendererpixbuf (gtk_cell_renderer_pixbuf_create_themed_pixbuf): Don't crash if a GIcon is not present in the current theme. Patch by Alex Larsson. svn path=/trunk/; revision=21650 --- ChangeLog | 9 +++++++++ gtk/gtkcellrendererpixbuf.c | 12 ++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a79607499b..c57b41b3a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-10-13 Matthias Clasen + + Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup + + * gtk/gtkcellrendererpixbuf + (gtk_cell_renderer_pixbuf_create_themed_pixbuf): Don't crash + if a GIcon is not present in the current theme. Patch by + Alex Larsson. + 2008-10-13 Matthias Clasen Bug 552318 – menubar mnemonics consumed even when diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index 87a73d673e..a75a88f058 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -454,8 +454,16 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf priv->gicon, MIN (width, height), GTK_ICON_LOOKUP_USE_BUILTIN); - cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error); - gtk_icon_info_free (info); + if (!info) + { + g_set_error (&error, GTK_ICON_THEME_ERROR, GTK_ICON_THEME_NOT_FOUND, + _("Icon not present in theme")); + } + else + { + cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, &error); + gtk_icon_info_free (info); + } } if (!cellpixbuf->pixbuf)