[gtk+/gtk-3-10] GtkIconCache: find_image_offset() return 0 if icon_name is NULL. This avoid a crash calling gtk_abou



commit bc7ce5eb74d6ad20053e9930d817e1938e291b56
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Thu Nov 28 16:56:11 2013 -0300

    GtkIconCache: find_image_offset() return 0 if icon_name is NULL.
    This avoid a crash calling gtk_about_dialog_set_logo_icon_name() with a NULL icon_name.

 gtk/gtkiconcache.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkiconcache.c b/gtk/gtkiconcache.c
index 09aaa1b..4eaff97 100644
--- a/gtk/gtkiconcache.c
+++ b/gtk/gtkiconcache.c
@@ -235,6 +235,9 @@ find_image_offset (GtkIconCache *cache,
   guint32 image_list_offset, n_images;
   int i;
 
+  if (!icon_name)
+    return 0;
+
   chain_offset = cache->last_chain_offset;
   if (chain_offset)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]