[vlc-commits] demux: subtitle: fix infinite loop #18071
Francois Cartegnie
git at videolan.org
Mon Mar 6 13:46:52 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 6 13:46:07 2017 +0100| [371099cd725f26438d076f01f9030de26d86f696] | committer: Francois Cartegnie
demux: subtitle: fix infinite loop #18071
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=371099cd725f26438d076f01f9030de26d86f696
---
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 7e7d6f5..09d552b 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -1296,6 +1296,7 @@ static int ParseSami( vlc_object_t *p_obj, subs_properties_t *p_props,
i_text = 0;
text[0] = '\0';
+ const char *psz_startline = s;
/* now get all txt until a "Start=" line */
for( ;; )
{
@@ -1312,7 +1313,8 @@ static int ParseSami( vlc_object_t *p_obj, subs_properties_t *p_props,
{
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