提交 a8fb7612 编写于 作者: M Michael Niedermayer

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/ffmpegReviewed-by: NNicolas George <george@nsup.org>
Signed-off-by: NMichael Niedermayer <michael@niedermayer.cc>
上级 32d6fe23
...@@ -94,6 +94,7 @@ static int microdvd_read_header(AVFormatContext *s) ...@@ -94,6 +94,7 @@ static int microdvd_read_header(AVFormatContext *s)
int64_t pos = avio_tell(s->pb); int64_t pos = avio_tell(s->pb);
int len = ff_get_line(s->pb, line_buf, sizeof(line_buf)); int len = ff_get_line(s->pb, line_buf, sizeof(line_buf));
char *line = line_buf; char *line = line_buf;
int64_t pts;
if (!strncmp(line, bom, 3)) if (!strncmp(line, bom, 3))
line += 3; line += 3;
...@@ -137,13 +138,16 @@ static int microdvd_read_header(AVFormatContext *s) ...@@ -137,13 +138,16 @@ static int microdvd_read_header(AVFormatContext *s)
SKIP_FRAME_ID; SKIP_FRAME_ID;
if (!*p) if (!*p)
continue; continue;
pts = get_pts(line);
if (pts == AV_NOPTS_VALUE)
continue;
sub = ff_subtitles_queue_insert(&microdvd->q, p, strlen(p), 0); sub = ff_subtitles_queue_insert(&microdvd->q, p, strlen(p), 0);
if (!sub) { if (!sub) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail; goto fail;
} }
sub->pos = pos; sub->pos = pos;
sub->pts = get_pts(line); sub->pts = pts;
sub->duration = get_duration(line); sub->duration = get_duration(line);
} }
ff_subtitles_queue_finalize(s, &microdvd->q); ff_subtitles_queue_finalize(s, &microdvd->q);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册