summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystem.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-12-06 19:15:24 +0100
committerBenjamin Otte <otte@redhat.com>2013-12-07 01:39:38 +0100
commit860138b302b00b3f7e5a9865195f0e67f6844260 (patch)
tree2c525fd93fc05ee4e4776ca12c99d779751c85ce /gtk/gtkfilesystem.c
parent904bc272500b804e7868f7233883604d5778d133 (diff)
downloadgtk+-860138b302b00b3f7e5a9865195f0e67f6844260.tar.gz
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
Diffstat (limited to 'gtk/gtkfilesystem.c')
-rw-r--r--gtk/gtkfilesystem.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c
index 65cca3f75a..b3509fefb5 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)