[Xfce4-commits] <thunar:xfce-4.8> Fix crash when trying to thumbnail a file with unknown content type.

Jannis Pohlmann noreply at xfce.org
Sat Feb 19 15:56:01 CET 2011


Updating branch refs/heads/xfce-4.8
         to 506851c47e6cf415d71d45a5c67ca05984423717 (commit)
       from a8bc7dfae527a4a3b63c93959c361ff0809fd91b (commit)

commit 506851c47e6cf415d71d45a5c67ca05984423717
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sat Feb 19 15:35:33 2011 +0100

    Fix crash when trying to thumbnail a file with unknown content type.

 NEWS                        |    4 ++++
 thunar/thunar-thumbnailer.c |   14 +++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 38c4449..b324c95 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+1.2.x
+=====
+- Fix crash when trying to thumbnail a file with unknown content type.
+
 1.2.1
 =====
 - Paste files in correct order (bug #6504).
diff --git a/thunar/thunar-thumbnailer.c b/thunar/thunar-thumbnailer.c
index 8146d29..93127a0 100644
--- a/thunar/thunar-thumbnailer.c
+++ b/thunar/thunar-thumbnailer.c
@@ -480,6 +480,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)
@@ -496,9 +507,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)
         {



More information about the Xfce4-commits mailing list