[gtk+/gtk-3-10] filechooser: Don't crash if invalid thumbnails exist



commit 47c6ffb7b148233c2f0e872d42fff748a3d786b9
Author: Benjamin Otte <otte redhat com>
Date:   Fri Dec 6 19:15:24 2013 +0100

    filechooser: Don't crash if invalid thumbnails exist
    
    Failing to load a thumbnail returns a NULL pixbuf. Since the hidpi
    patches this wasn't checked when creating the surface. Result: assertion
    failure.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719977

 gtk/gtkfilesystem.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c
index 65cca3f..b3509fe 100644
--- a/gtk/gtkfilesystem.c
+++ b/gtk/gtkfilesystem.c
@@ -813,9 +813,12 @@ _gtk_file_info_render_icon (GFileInfo *info,
                                                 icon_size*scale, icon_size*scale,
                                                 NULL);
 
-      surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale,
-                                                      gtk_widget_get_window (widget));
-      g_object_unref (pixbuf);
+      if (pixbuf != NULL)
+        {
+          surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale,
+                                                          gtk_widget_get_window (widget));
+          g_object_unref (pixbuf);
+        }
     }
 
   if (!surface)


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