[vlc-commits] jacosub: Fix format specifier

Hugo Beauzée-Luyssen git at videolan.org
Tue Jan 30 15:59:33 CET 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jan 30 13:12:14 2018 +0100| [c7e7a8375b12a063131fa0bdb110a5fdf5decda9] | committer: Hugo Beauzée-Luyssen

jacosub: Fix format specifier

%[] will always attempt to store a final 0, which doesn't fit here.

(cherry picked from commit 4bfa7204ae4fa3546813f6c9ed3a7d9d2cf6f58a)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

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

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 486f3e61f3..1fb6530c8c 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -2419,7 +2419,8 @@ static int ParseSCC( vlc_object_t *p_obj, subs_properties_t *p_props,
 
         unsigned h, m, s, f;
         char c;
-        if( sscanf( psz_line, "%u:%u:%u%[:;]%u ", &h, &m, &s, &c, &f ) != 5 )
+        if( sscanf( psz_line, "%u:%u:%u%c%u ", &h, &m, &s, &c, &f ) != 5 ||
+                ( c != ':' && c != ';' ) )
             continue;
 
         /* convert everything to seconds */



More information about the vlc-commits mailing list