[rhythmbox] grilo: fix crash due NULL url from GrlMedia
- From: Victor Toso de Carvalho <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] grilo: fix crash due NULL url from GrlMedia
- Date: Tue, 17 May 2016 06:26:12 +0000 (UTC)
commit 3e986dd5c959b8d5ec3b5b2cffa72f81323d8cbe
Author: Victor Toso <me victortoso com>
Date: Fri May 13 23:16:31 2016 +0200
grilo: fix crash due NULL url from GrlMedia
#0 g_str_hash (v=0x0) at ghash.c:1876
#1 in g_hash_table_lookup_node (hash_return=<synthetic pointer>,
key=0x0, hash_table=0x604640) at ghash.c:375
#2 g_hash_table_lookup (hash_table=0x604640, key=key entry=0x0) at ghash.c:1147
#3 in rb_refstring_find (init=0x0) at rb-refstring.c:122
#4 in rhythmdb_entry_lookup_by_location (db=0x76a490, uri=<optimized out>)
at rhythmdb.c:4036
#5 in create_entry_for_media (container=0x0, data=0xcb5360,
entry_type=<optimized out>, db=0x76a490) at rb-grilo-source.c:553
https://bugzilla.gnome.org/show_bug.cgi?id=766392
plugins/grilo/rb-grilo-source.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/plugins/grilo/rb-grilo-source.c b/plugins/grilo/rb-grilo-source.c
index 22a9d11..b57e4a6 100644
--- a/plugins/grilo/rb-grilo-source.c
+++ b/plugins/grilo/rb-grilo-source.c
@@ -549,8 +549,14 @@ create_entry_for_media (RhythmDB *db, RhythmDBEntryType *entry_type, GrlData *da
{
RhythmDBEntry *entry;
RBGriloEntryData *entry_data;
+ const gchar *url;
- entry = rhythmdb_entry_lookup_by_location (db, grl_media_get_url (GRL_MEDIA (data)));
+ url = grl_media_get_url (GRL_MEDIA (data));
+ if (url == NULL) {
+ return NULL;
+ }
+
+ entry = rhythmdb_entry_lookup_by_location (db, url);
if (entry != NULL) {
return entry;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]