vlc | branch: master | Francois Cartegnie <[email protected]> | Wed Oct  7 
19:59:00 2015 +0200| [9abec5a24c3235aef4ff1fed1ae1a97f104930fa] | committer: 
Francois Cartegnie

playlist: wpl: probe without using xml reader

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

 modules/demux/playlist/wpl.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/demux/playlist/wpl.c b/modules/demux/playlist/wpl.c
index 121ffd2..8e83434 100644
--- a/modules/demux/playlist/wpl.c
+++ b/modules/demux/playlist/wpl.c
@@ -27,6 +27,7 @@
 #include <vlc_common.h>
 #include <vlc_demux.h>
 #include <vlc_xml.h>
+#include <vlc_fixups.h>
 
 #include "playlist.h"
 
@@ -179,6 +180,12 @@ int Import_WPL( vlc_object_t* p_this )
 
     demux_sys_t* p_sys = p_demux->p_sys;
 
+    uint8_t *p_peek;
+    ssize_t i_peek = stream_Peek( p_demux->s, (const uint8_t **) &p_peek, 128 
);
+    if( i_peek < 32 || memcmp( p_peek, "<?wpl", 5 ) ||
+        !strnstr( (const char *) p_peek, "<smil>", i_peek ) )
+        return VLC_EGENERIC;
+
     p_sys->p_reader = xml_ReaderCreate( p_this, p_demux->s );
     if ( !p_sys->p_reader )
     {

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to