[evolution-rss] do not crash on empty image files



commit a7702547a611415fd1e69036b79b44cd3d9734fa
Author: Lucian Langa <lucilanga gnome org>
Date:   Mon May 24 23:03:57 2010 +0300

    do not crash on empty image files

 TODO            |    4 +---
 src/rss-image.c |   17 ++++++++++-------
 2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/TODO b/TODO
index 200507c..e84032f 100644
--- a/TODO
+++ b/TODO
@@ -39,6 +39,4 @@
 	* delete of articles not present does not work when no deletion option selected
 	* add select all for feed list or perhaps delete all - manually select each record and pressing delete is a pain on a 10000 feed list
 	* check key->session big memleak ?
-	* finish setup loose the auth info for disaplay feed icon
-	* *.rec info does not get deleted, reusing .rec info results in auth failure
-	* markup failed perhaps in web auth dialog
+	* markup fail perhaps in web auth dialog
diff --git a/src/rss-image.c b/src/rss-image.c
index f67ae79..ddd2281 100644
--- a/src/rss-image.c
+++ b/src/rss-image.c
@@ -478,7 +478,8 @@ verify_image(gchar *uri, EMFormatHTML *format)
 	gsize length;
 	gchar *nurl, *turl;
 	gchar *base_dir, *feed_dir, *name;
-	gchar *scheme, *result, *tname;
+	gchar *scheme, *tname;
+	gchar *result = NULL;
 	gchar *duri = NULL;
 	gsize size;
 
@@ -514,10 +515,12 @@ verify_image(gchar *uri, EMFormatHTML *format)
 				g_free(scheme);
 			}
 			g_free(base_dir);
-			tname = decode_image_cache_filename(name);
-			g_free(name);
-			result = g_filename_to_uri (tname, NULL, NULL);
-			g_free(tname);
+			if (name) {
+				tname = decode_image_cache_filename(name);
+				g_free(name);
+				result = g_filename_to_uri (tname, NULL, NULL);
+				g_free(tname);
+			}
 			if (duri)
 				g_free(duri);
 			return result;
@@ -600,9 +603,9 @@ fetch_image_redraw(gchar *url, gchar *link, gpointer data)
 			tmpurl)) {
 		goto working;
 	}
-	d("fetch_image_redraw() tmpurl:%s, intern: %s\n",
-		tmpurl, intern);
 	cache_file = rss_cache_get_filename(intern);
+	d("fetch_image_redraw() tmpurl:%s, intern: %s\n",
+		tmpurl, cache_file);
 	if (!g_file_test (cache_file, G_FILE_TEST_EXISTS)) {
 		d("image cache MISS\n");
 		if (data) {



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