@@ -78,7 +78,7 @@ static int webvtt_read_header(AVFormatContext *s)
int i;
int64_t pos;
AVPacket *sub;
- const char *p, *identifier, *settings;
+ const char *p, *identifier, *settings, *arrow;
int identifier_len, settings_len;
int64_t ts_start, ts_end;
@@ -120,12 +120,13 @@ static int webvtt_read_header(AVFormatContext *s)
p++;
}
+ if (!(arrow = strstr(p, "-->")))
+ continue;
+
/* cue timestamps */
if ((ts_start = read_ts(p)) == AV_NOPTS_VALUE)
break;
- if (!(p = strstr(p, "-->")))
- break;
- p += 2;
+ p = arrow + 2;
do p++; while (*p == ' ' || *p == '\t');
if ((ts_end = read_ts(p)) == AV_NOPTS_VALUE)
break;