summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Ryan <mark.d.ryan@intel.com>2012-04-05 09:45:56 +0200
committerJens Georg <mail@jensge.org>2012-04-20 13:07:06 +0200
commitad7fa6b33300393110f51851cb8e31b4c16b1c8d (patch)
tree5c883168d283394f64d07b41e24a195e8940f035
parent8635c16413c5a81d0a44e936c200ecd9a6de3d54 (diff)
downloadgupnp-av-ad7fa6b33300393110f51851cb8e31b4c16b1c8d.tar.gz
Fixed a crash in gupnp_didl_lite_contributor_get_name
The crash occurs if the DIDL contains an empty artists tag, e.g., <upnp:artist></upnp:artist>. A call to gupnp_didl_lite_object_get_artists results in a list of one element. However, invoking gupnp_didl_lite_contributor_get_name on this element causes a crash. The fix works by modifying get_contributor_list_by_name so that it does not add empty artists nodes to the list of contributors it creates. https://bugzilla.gnome.org/show_bug.cgi?id=674319
-rw-r--r--libgupnp-av/gupnp-didl-lite-object.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgupnp-av/gupnp-didl-lite-object.c b/libgupnp-av/gupnp-didl-lite-object.c
index fc59da1..4482b58 100644
--- a/libgupnp-av/gupnp-didl-lite-object.c
+++ b/libgupnp-av/gupnp-didl-lite-object.c
@@ -797,6 +797,8 @@ get_contributor_list_by_name (GUPnPDIDLLiteObject *object,
xmlNode *contributor_node;
contributor_node = (xmlNode *) l->data;
+ if (!contributor_node->children)
+ continue;
contributor = gupnp_didl_lite_contributor_new_from_xml
(contributor_node,