[vlc-commits] demux: subtitle: fix infinite loop #18071
Francois Cartegnie
git at videolan.org
Mon Mar 6 13:48:38 CET 2017
vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 6 13:46:07 2017 +0100| [f635a90aaccd3cedbe532a336d9b133af9923626] | committer: Francois Cartegnie
demux: subtitle: fix infinite loop #18071
backport of 371099cd725f26438d076f01f9030de26d86f696
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=f635a90aaccd3cedbe532a336d9b133af9923626
---
modules/demux/subtitle.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index c2877a0..ccfc9cf 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -1271,6 +1271,7 @@ static int ParseSami( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
i_text = 0;
text[0] = '\0';
+ const char *psz_startline = s;
/* now get all txt until a "Start=" line */
for( ;; )
{
@@ -1287,7 +1288,8 @@ static int ParseSami( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
{
c = '\n';
}
- else if( strcasestr( s, "Start=" ) )
+ else if( strcasestr( s, "Start=" ) &&
+ psz_startline != s )
{
TextPreviousLine( txt );
break;
More information about the vlc-commits
mailing list