[vlc-commits] ttml demux: Don't try to parse head tag if seeking fails

Hugo Beauzée-Luyssen git at videolan.org
Thu Sep 15 14:22:39 CEST 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Sep 15 14:21:57 2016 +0200| [9aedcd2584914bc0d60893dd59132d7f3e4827c2] | committer: Hugo Beauzée-Luyssen

ttml demux: Don't try to parse head tag if seeking fails

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

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

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index a3c806b..443f560 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -775,7 +775,11 @@ static void ParseHead( demux_t* p_demux )
     ssize_t i_read;
 
     // Rewind since the XML parser will have consumed the entire file.
-    vlc_stream_Seek( p_demux->s, 0 );
+    if ( vlc_stream_Seek( p_demux->s, 0 ) != VLC_SUCCESS )
+    {
+        msg_Warn( p_demux, "Failed to rewind to parse <head>. No style will be available" );
+        return;
+    }
 
     while( ( i_read = vlc_stream_Read( p_demux->s, (void*)buff, 1024 ) ) > 0 )
     {



More information about the vlc-commits mailing list