After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689094 - Some fixes for DIDL_S parsing.
Some fixes for DIDL_S parsing.
Product: gupnp-av
Classification: Other
Component: General
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Reported: 2012-11-26 16:39 UTC by Krzesimir Nowak
Modified: 2019-02-22 05:57 UTC
See Also:
GNOME target: ---
GNOME version: ---

Fixes gupnp_didl_lite_parser_parse_didl. (1.34 KB, patch)
2012-11-26 16:40 UTC, Krzesimir Nowak
committed Details | Review
Fixes some issues with reference counting and parsing. (6.70 KB, patch)
2012-11-26 16:40 UTC, Krzesimir Nowak
committed Details | Review
Test case (1.32 KB, application/xml)
2012-11-27 16:22 UTC, Krzesimir Nowak

Description Krzesimir Nowak 2012-11-26 16:39:04 UTC
First patch fixes a function that should return a value but does not.
Second patch fixes a possible situation when xml_doc is freed to many times because of ignoring parsing failure. Also, it clears members of media collection when parsing of string fails after calling media_collection_new_from_string.

Patches will follow.
Comment 1 Krzesimir Nowak 2012-11-26 16:40:06 UTC
Created attachment 229915 [details] [review]
Fixes gupnp_didl_lite_parser_parse_didl.

First one.
Comment 2 Krzesimir Nowak 2012-11-26 16:40:53 UTC
Created attachment 229916 [details] [review]
Fixes some issues with reference counting and parsing.

Comment 3 Krzesimir Nowak 2012-11-27 16:22:50 UTC
Created attachment 230015 [details]
Test case

I attached a file for which the critical message was displayed. Also, I ran Rygel with playlist item under debugger just to see how this file is processed. So, gupnp_didl_lite_parser_parse_didl_recursive creates a GUPnPXMLDoc and calls parse_elements, which calls itself recursively when processing containers. Everytime this function quits, it unrefs xml_doc. So, in case when document has a container the parse_elements is called twice and xml_doc is unreffed twice. Instead of doing xml_doc unreffing in parse_elements I moved it back to function where it was created to ensure ref/unref parity. Also, I added a check for return value of parse_elements when called recursive to avoid further parsing if there was an error.

The another change I added to media collection was to clean itself when parsing failed. Thus by checking if there is no title and no author and no items we can be sure that parsing indeed failed.
Comment 4 Jens Georg 2012-11-28 12:19:02 UTC
Wonder why that didn't show in the media collection tests.