From ca80f9d9140d950891c8fb0e7ac31981186617f5 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 15 Oct 2012 17:13:11 +0200 Subject: [PATCH] Add pbuf nullity checks --- gtk/main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk/main.c b/gtk/main.c index 193803256..b773a5b7f 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -279,8 +279,10 @@ static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name) linphone_gtk_visibility_set(shown,window_name,w,TRUE); if (icon_path) { GdkPixbuf *pbuf=create_pixbuf(icon_path); - gtk_window_set_icon(GTK_WINDOW(w),pbuf); - g_object_unref(G_OBJECT(pbuf)); + if(pbuf != NULL) { + gtk_window_set_icon(GTK_WINDOW(w),pbuf); + g_object_unref(G_OBJECT(pbuf)); + } } } @@ -1526,8 +1528,10 @@ static void linphone_gtk_configure_main_window(){ } if (search_icon){ GdkPixbuf *pbuf=create_pixbuf(search_icon); - gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"directory_search_button_icon")),pbuf); - g_object_unref(G_OBJECT(pbuf)); + if(pbuf != NULL) { + gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"directory_search_button_icon")),pbuf); + g_object_unref(G_OBJECT(pbuf)); + } } if (home){ gchar *tmp;