diff --git a/libavformat/subviewerdec.c b/libavformat/subviewerdec.c index f1b0fdf0a5..d5dd1aafa2 100644 --- a/libavformat/subviewerdec.c +++ b/libavformat/subviewerdec.c @@ -132,6 +132,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) {