Commit 6557778d authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

do not strcmp the GError message, use error->code instead. Do not access()

2009-04-03  Carlos Garnacho  <carlos@imendio.com>

        * src/libtracker-common/tracker-albumart.c
        (tracker_albumart_queue_cb): do not strcmp the GError message, use
        error->code instead. Do not access() NULL paths.
        (tracker_albumart_get_path): Improve memory management if the function
        exits prematurely.
        * src/tracker-extract/tracker-extract-albumart.c
        (tracker_process_albumart): bail out if it couldn't get art_path.

svn path=/trunk/; revision=3169
parent 4df5fe4c
2009-04-03 Carlos Garnacho <carlos@imendio.com>
* src/libtracker-common/tracker-albumart.c
(tracker_albumart_queue_cb): do not strcmp the GError message, use
error->code instead. Do not access() NULL paths.
(tracker_albumart_get_path): Improve memory management if the function
exits prematurely.
* src/tracker-extract/tracker-extract-albumart.c
(tracker_process_albumart): bail out if it couldn't get art_path.
2009-04-02 Mikael Ottela <mikael.ottela@ixonos.com>
* src/tracker-extract/tracker-extract-gstreamer.c: Watch for
......
......@@ -546,14 +546,15 @@ tracker_albumart_queue_cb (DBusGProxy *proxy,
G_TYPE_INVALID);
if (error) {
if (g_strcmp0 (error->message, "The name " ALBUMARTER_SERVICE " was not provided by any .service files") == 0)
if (error->code == DBUS_GERROR_SERVICE_UNKNOWN)
no_more_requesting = TRUE;
else
g_warning ("%s", error->message);
g_clear_error (&error);
}
if (g_file_test (info->art_path, G_FILE_TEST_EXISTS)) {
if (info->art_path &&
g_file_test (info->art_path, G_FILE_TEST_EXISTS)) {
gchar *uri;
uri = g_filename_to_uri (info->art_path, NULL, NULL);
......@@ -585,7 +586,13 @@ tracker_albumart_get_path (const gchar *a,
/* http://live.gnome.org/MediaArtStorageSpec */
*path = NULL;
if (path) {
*path = NULL;
}
if (local_uri) {
*local_uri = NULL;
}
if (!a && !b) {
return;
......
......@@ -132,6 +132,13 @@ tracker_process_albumart (const unsigned char *buffer,
&art_path,
&local_uri);
if (!art_path) {
g_free (filename_uri);
g_free (local_uri);
return FALSE;
}
if (!g_file_test (art_path, G_FILE_TEST_EXISTS)) {
#ifdef HAVE_GDKPIXBUF
/* If we have embedded album art */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment