[tracker/direct-access] tracker-extract: Fix crash in albumart when pixbuf cannot be created
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access] tracker-extract: Fix crash in albumart when pixbuf cannot be created
- Date: Tue, 20 Jul 2010 15:24:05 +0000 (UTC)
commit 7a442afa390e2d846d110aee981fb0daf9827815
Author: Jürg Billeter <j bitron ch>
Date: Tue Jul 20 17:19:38 2010 +0200
tracker-extract: Fix crash in albumart when pixbuf cannot be created
src/tracker-extract/tracker-albumart-pixbuf.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-albumart-pixbuf.c b/src/tracker-extract/tracker-albumart-pixbuf.c
index b8b3bc9..aea1052 100644
--- a/src/tracker-extract/tracker-albumart-pixbuf.c
+++ b/src/tracker-extract/tracker-albumart-pixbuf.c
@@ -86,6 +86,14 @@ tracker_albumart_buffer_to_jpeg (const unsigned char *buffer,
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+ if (pixbuf == NULL) {
+ g_warning ("Could not get pixbuf from GdkPixbufLoader when setting album art");
+
+ gdk_pixbuf_loader_close (loader, NULL);
+
+ return FALSE;
+ }
+
if (!gdk_pixbuf_save (pixbuf, target, "jpeg", &error, NULL)) {
g_warning ("Could not save GdkPixbuf when setting album art, %s",
error ? error->message : "no error given");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]