[vlc-commits] demux: ttml: probe tags with breaks

Francois Cartegnie git at videolan.org
Sun Dec 31 22:21:35 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Dec 31 22:17:06 2017 +0100| [ea07b73ee2dd66ce71d0f4e16528ba16a46f9ced] | committer: Francois Cartegnie

demux: ttml: probe tags with breaks

refs #19329

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

 modules/demux/ttml.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index bc4f8cdbe0..d4d0755e9f 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -36,6 +36,7 @@
 
 #include <assert.h>
 #include <stdlib.h>
+#include <ctype.h>
 
 #include "../codec/ttml/ttml.h"
 
@@ -439,8 +440,9 @@ int tt_OpenDemux( vlc_object_t* p_this )
     }
 
     /* Simplified probing. Valid TTML must have a namespace declaration */
-    const char *psz_tt = strnstr( psz_xml, "tt ", i_xml );
+    const char *psz_tt = strnstr( psz_xml, "tt", i_xml );
     if( !psz_tt || psz_tt == psz_xml ||
+        ((size_t)(&psz_tt[2] - (const char*)p_peek)) == i_xml || isalpha(psz_tt[2]) ||
         (psz_tt[-1] != ':' && psz_tt[-1] != '<') )
     {
         free( psz_alloc );



More information about the vlc-commits mailing list