Skip to content

Commit

Permalink
[Playlist] dont use istream directly to a tinyxml structure
Browse files Browse the repository at this point in the history
Turn istream into a std::string to handle large buffers (xbmc#20305)
  • Loading branch information
fuzzard committed Oct 12, 2021
1 parent c7ee2d8 commit 80c8138
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xbmc/playlists/PlayListPLS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ bool CPlayListASX::LoadData(std::istream& stream)
}
else
{
std::string asxstream(std::istreambuf_iterator<char>(stream), {});
CXBMCTinyXML xmlDoc;
stream >> xmlDoc;
xmlDoc.Parse(asxstream, TIXML_DEFAULT_ENCODING);

if (xmlDoc.Error())
{
Expand All @@ -300,6 +301,9 @@ bool CPlayListASX::LoadData(std::istream& stream)

TiXmlElement *pRootElement = xmlDoc.RootElement();

if (!pRootElement)
return false;

// lowercase every element
TiXmlNode *pNode = pRootElement;
TiXmlNode *pChild = NULL;
Expand Down

0 comments on commit 80c8138

Please sign in to comment.