[vlc-commits] demux: subtitle: fix unchecked seek warning

Francois Cartegnie git at videolan.org
Tue Jan 24 17:25:44 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 24 17:23:56 2017 +0100| [aee23e64ad40b73229dfb1539633e63a2ea55255] | committer: Francois Cartegnie

demux: subtitle: fix unchecked seek warning

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

 modules/demux/subtitle.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 5c01237..782f6f1 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -526,8 +526,12 @@ static int Open ( vlc_object_t *p_this )
 
     msg_Dbg( p_demux, "loading all subtitles..." );
 
-    if( unicode ) /* skip BOM */
-        vlc_stream_Seek( p_demux->s, 3 );
+    if( unicode && /* skip BOM */
+        vlc_stream_Seek( p_demux->s, 3 ) != VLC_SUCCESS )
+    {
+        Close( p_this );
+        return VLC_EGENERIC;
+    }
 
     /* Load the whole file */
     TextLoad( &p_sys->txt, p_demux->s );



More information about the vlc-commits mailing list