summaryrefslogtreecommitdiff
path: root/libavformat/mpsubdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mpsubdec.c')
-rw-r--r--libavformat/mpsubdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c
index 6a0cefbeb6..c5bdcdb626 100644
--- a/libavformat/mpsubdec.c
+++ b/libavformat/mpsubdec.c
@@ -37,11 +37,16 @@ static int mpsub_probe(AVProbeData *p)
const char *ptr_end = p->buf + p->buf_size;
while (ptr < ptr_end) {
+ int inc;
+
if (!memcmp(ptr, "FORMAT=TIME", 11))
return AVPROBE_SCORE_EXTENSION;
if (!memcmp(ptr, "FORMAT=", 7))
return AVPROBE_SCORE_EXTENSION / 3;
- ptr += strcspn(ptr, "\n") + 1;
+ inc = ff_subtitles_next_line(ptr);
+ if (!inc)
+ break;
+ ptr += inc;
}
return 0;
}