[vlc-commits] demux/playlist: wpl: fix skipping of elements containing self-closed ones

Filip Roséen git at videolan.org
Fri Mar 17 19:01:16 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Fri Mar 17 12:05:08 2017 +0100| [902746ac0451a6797002d2f7f4304e456b43acbe] | committer: Jean-Baptiste Kempf

demux/playlist: wpl: fix skipping of elements containing self-closed ones

As there will be no corresponding ENDELEM for tags that are
self-closing, the previous implementation would increase "i_depth"
without a real chance of bring it back to zero.

These changes fixes that issue.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=902746ac0451a6797002d2f7f4304e456b43acbe
---

 modules/demux/playlist/wpl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/demux/playlist/wpl.c b/modules/demux/playlist/wpl.c
index 48d2c0a..b036c7f 100644
--- a/modules/demux/playlist/wpl.c
+++ b/modules/demux/playlist/wpl.c
@@ -52,7 +52,10 @@ static int consume_tag( xml_reader_t* p_reader, char const* psz_tag )
                 return VLC_SUCCESS;
         }
         else if( i_type == XML_READER_STARTELEM && !strcasecmp( psz_name, psz_tag ) )
-            ++i_depth;
+        {
+            if( xml_ReaderIsEmptyElement( p_reader ) != 1 )
+                ++i_depth;
+        }
     }
 
     return VLC_EGENERIC;



More information about the vlc-commits mailing list