• Filip Roséen's avatar
    demux/adaptive: DOMParser: retain root element if empty · 9ac321c6
    Filip Roséen authored
    An XML file containing a single root element without children would,
    given the previous implementation, have its only element ignored.
    Resulting in a memory-leak of the node in question, while also (more
    importantly) making it impossible to access the associated data.
    
    As XML does not allow documents such as the below (only a single root
    is allowed):
    
       <?xml version="1.0">
       <ill-formed />
       <ill-formed></ill-formed>
    
    Simply checking to see so that we are not popping away all our tags
    are sufficient in order to fix this bug. The changes also make sure
    that we do not invoke std::stack<...>::pop on an empty container
    (which is undefined-behavior).
    
    fixes: #18122
    Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
    9ac321c6
Name
Last commit
Last update
..
DOMHelper.cpp Loading commit data...
DOMHelper.h Loading commit data...
DOMParser.cpp Loading commit data...
DOMParser.h Loading commit data...
Node.cpp Loading commit data...
Node.h Loading commit data...