summaryrefslogtreecommitdiff
path: root/ffmpeg/libavformat/jacosubdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/libavformat/jacosubdec.c')
-rw-r--r--ffmpeg/libavformat/jacosubdec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ffmpeg/libavformat/jacosubdec.c b/ffmpeg/libavformat/jacosubdec.c
index 89e7e1b..e77ab40 100644
--- a/ffmpeg/libavformat/jacosubdec.c
+++ b/ffmpeg/libavformat/jacosubdec.c
@@ -43,8 +43,9 @@ typedef struct {
static int timed_line(const char *ptr)
{
char c;
+ int fs, fe;
return (sscanf(ptr, "%*u:%*u:%*u.%*u %*u:%*u:%*u.%*u %c", &c) == 1 ||
- sscanf(ptr, "@%*u @%*u %c", &c) == 1);
+ (sscanf(ptr, "@%u @%u %c", &fs, &fe, &c) == 3 && fs < fe));
}
static int jacosub_probe(AVProbeData *p)
@@ -60,10 +61,10 @@ static int jacosub_probe(AVProbeData *p)
ptr++;
if (*ptr != '#' && *ptr != '\n') {
if (timed_line(ptr))
- return AVPROBE_SCORE_MAX/2 + 1;
+ return AVPROBE_SCORE_EXTENSION + 1;
return 0;
}
- ptr += strcspn(ptr, "\n") + 1;
+ ptr += ff_subtitles_next_line(ptr);
}
return 0;
}