diff options
author | Jannis Pohlmann <jannis@xfce.org> | 2011-02-19 15:35:33 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis@xfce.org> | 2011-02-19 15:35:33 +0100 |
commit | b3f4ba8174af70d4aed5068333014ddd0d5e620d (patch) | |
tree | df3af595a6c8a768db7d8e648729f623f002ad20 | |
parent | 2ea05d8bff3773803517f7ab9cd415efcbfc9991 (diff) | |
download | thunar-b3f4ba8174af70d4aed5068333014ddd0d5e620d.tar.gz |
Fix crash when trying to thumbnail a file with unknown content type.
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | thunar/thunar-thumbnailer.c | 14 |
2 files changed, 15 insertions, 3 deletions
@@ -1,3 +1,7 @@ +1.3.x +===== +- Fix crash when trying to thumbnail a file with unknown content type. + 1.3.0 ===== - Paste files in correct order (bug #6504). diff --git a/thunar/thunar-thumbnailer.c b/thunar/thunar-thumbnailer.c index 32d6218a..b902d4eb 100644 --- a/thunar/thunar-thumbnailer.c +++ b/thunar/thunar-thumbnailer.c @@ -396,6 +396,17 @@ thunar_thumbnailer_file_is_supported (ThunarThumbnailer *thumbnailer, return FALSE; } + /* determine the content type of the passed file */ + content_type = thunar_file_get_content_type (file); + + /* abort if the content type is unknown */ + if (content_type == NULL) + { + /* release the thumbnailer lock */ + g_mutex_unlock (thumbnailer->lock); + return FALSE; + } + /* request the supported types on demand */ if (thumbnailer->supported_schemes == NULL || thumbnailer->supported_types == NULL) @@ -412,9 +423,6 @@ thunar_thumbnailer_file_is_supported (ThunarThumbnailer *thumbnailer, if (thumbnailer->supported_schemes != NULL && thumbnailer->supported_types != NULL) { - /* determine the content type of the passed file */ - content_type = thunar_file_get_content_type (file); - /* go through all the URI schemes we support */ for (n = 0; !supported && thumbnailer->supported_schemes[n] != NULL; ++n) { |