[vlc-commits] demux: adaptive: handle EXTM3U header violations

Francois Cartegnie git at videolan.org
Tue Oct 31 22:11:34 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct 31 16:18:01 2017 +0100| [0e5e8108cc48ba734f8d392c5ff73ba8d4690c60] | committer: Francois Cartegnie

demux: adaptive: handle EXTM3U header violations

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

 modules/demux/hls/playlist/Parser.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 0f0514624b..9cba6f1903 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -378,7 +378,8 @@ void M3U8Parser::parseSegments(vlc_object_t *, Representation *rep, const std::l
 M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::string &playlisturl)
 {
     char *psz_line = vlc_stream_ReadLine(p_stream);
-    if(!psz_line || strcmp(psz_line, "#EXTM3U"))
+    if(!psz_line || strncmp(psz_line, "#EXTM3U", 7) ||
+       (psz_line[0] && !std::isspace(psz_line[7])))
     {
         free(psz_line);
         return NULL;



More information about the vlc-commits mailing list