[vlc-commits] demux: ttml: probe tags with breaks
Francois Cartegnie
git at videolan.org
Wed Jan 17 16:12:59 CET 2018
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Dec 31 22:17:06 2017 +0100| [d913edbb972c01195dd255db9f9a426ba9aec26e] | committer: Jean-Baptiste Kempf
demux: ttml: probe tags with breaks
refs #19329
(cherry picked from commit ea07b73ee2dd66ce71d0f4e16528ba16a46f9ced)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d913edbb972c01195dd255db9f9a426ba9aec26e
---
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