[vlc-devel] [PATCH] demux/playlist: wpl: fix skipping of elements	containing self-closed ones
    Filip Roséen 
    filip at atch.se
       
    Fri Mar 17 12:05:08 CET 2017
    
    
  
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.
--
Thanks to Francois Cartegnie for point out the issue:
 - https://mailman.videolan.org/pipermail/vlc-devel/2017-March/112250.html
---
 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 48d2c0a47f..b036c7f0ba 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;
-- 
2.12.0
    
    
More information about the vlc-devel
mailing list