diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 2e0f22f4df..11c7f75fc0 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -679,6 +679,8 @@ static int concat_read_header(AVFormatContext *avf) cat->files[i].user_duration = cat->files[i].outpoint - cat->files[i].inpoint; } cat->files[i].duration = cat->files[i].user_duration; + if (time + (uint64_t)cat->files[i].user_duration > INT64_MAX) + return AVERROR_INVALIDDATA; time += cat->files[i].user_duration; } if (i == cat->nb_files) {