Skip to content

Commit

Permalink
avformat/subviewerdec: fail on AV_NOPTS_VALUE
Browse files Browse the repository at this point in the history
Such values are not supported by ff_subtitles_queue*

Fixes: signed integer overflow: 10 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 24193/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5714901855895552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Oct 15, 2020
1 parent 0c90377 commit b7f5142
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libavformat/subviewerdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ static int subviewer_read_header(AVFormatContext *s)
new_event = 1;
pos = avio_tell(s->pb);
} else if (*line) {
if (pts_start == AV_NOPTS_VALUE) {
res = AVERROR_INVALIDDATA;
goto end;
}
if (!new_event) {
sub = ff_subtitles_queue_insert(&subviewer->q, "\n", 1, 1);
if (!sub) {
Expand Down

0 comments on commit b7f5142

Please sign in to comment.