aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-03-13 20:58:32 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-03-13 20:58:32 +0800
commit0a3955c5de625a95eec9d1320d8cc8a24dade021 (patch)
tree4da20f5bd12b90033a39cb2d1b61a7c0bf557a63 /widgets
parent4c98736f86d1fe10d16651d8fa7e7452d3c75b31 (diff)
downloadgsoc2013-evolution-0a3955c5de625a95eec9d1320d8cc8a24dade021.tar
gsoc2013-evolution-0a3955c5de625a95eec9d1320d8cc8a24dade021.tar.gz
gsoc2013-evolution-0a3955c5de625a95eec9d1320d8cc8a24dade021.tar.bz2
gsoc2013-evolution-0a3955c5de625a95eec9d1320d8cc8a24dade021.tar.lz
gsoc2013-evolution-0a3955c5de625a95eec9d1320d8cc8a24dade021.tar.xz
gsoc2013-evolution-0a3955c5de625a95eec9d1320d8cc8a24dade021.tar.zst
gsoc2013-evolution-0a3955c5de625a95eec9d1320d8cc8a24dade021.zip
** Fix for bug #460204
2008-03-13 Milan Crha <mcrha@redhat.com> ** Fix for bug #460204 * e-attachment.c: (attachment_guess_mime_type): Check whether found mime type is valid before returning it. My thanks come to Effenberg whom helped me to debug it. svn path=/trunk/; revision=35184
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-attachment.c11
2 files changed, 19 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 8714f3ff64..6186c3dbf6 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,5 +1,13 @@
2008-03-13 Milan Crha <mcrha@redhat.com>
+ ** Fix for bug #460204
+
+ * e-attachment.c: (attachment_guess_mime_type):
+ Check whether found mime type is valid before returning it.
+ My thanks come to Effenberg whom helped me to debug it.
+
+2008-03-13 Milan Crha <mcrha@redhat.com>
+
** Fix for bug #512543
* e-calendar-item.c: Get rid of ENABLE_CAIRO define.
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 4bbaebd3ab..1383335499 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -275,6 +275,17 @@ attachment_guess_mime_type (const char *file_name)
gnome_vfs_file_info_unref (info);
+ if (type) {
+ /* gnome_vfs can sometimes return invalid type, so check for it */
+ CamelContentType *ctype = camel_content_type_decode (type);
+
+ if (!ctype) {
+ g_free (type);
+ type = NULL;
+ } else
+ camel_content_type_unref (ctype);
+ }
+
return type;
}