aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-23 01:43:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit620374a3af3e5b506e39713dadfde9d3ac9ca0f6 (patch)
tree3593adf1265d3023919c2116746907e98fb3740d
parentf6e7fbd510d53af2c7f727e03239569b95d333e2 (diff)
downloadffmpeg-620374a3af3e5b506e39713dadfde9d3ac9ca0f6.tar.gz
avformat/microdvddec: skip malformed lines without frame number.
Fixes: signed integer overflow: 1 - -9223372036854775808 cannot be represented in type 'long' Fixes: 23490/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5133490093031424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a8fb7612a97530bdd0b2549dacf91dcf71a3187a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/microdvddec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/microdvddec.c b/libavformat/microdvddec.c
index c2f1ac45cd..bf71c5e770 100644
--- a/libavformat/microdvddec.c
+++ b/libavformat/microdvddec.c
@@ -94,6 +94,7 @@ static int microdvd_read_header(AVFormatContext *s)
int64_t pos = avio_tell(s->pb);
int len = ff_get_line(s->pb, line_buf, sizeof(line_buf));
char *line = line_buf;
+ int64_t pts;
if (!strncmp(line, bom, 3))
line += 3;
@@ -134,11 +135,14 @@ static int microdvd_read_header(AVFormatContext *s)
SKIP_FRAME_ID;
if (!*p)
continue;
+ pts = get_pts(line);
+ if (pts == AV_NOPTS_VALUE)
+ continue;
sub = ff_subtitles_queue_insert(&microdvd->q, p, strlen(p), 0);
if (!sub)
return AVERROR(ENOMEM);
sub->pos = pos;
- sub->pts = get_pts(line);
+ sub->pts = pts;
sub->duration = get_duration(line);
}
ff_subtitles_queue_finalize(s, &microdvd->q);