diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c index c11244ef3d..4d6ae7abc5 100644 --- a/libavformat/sbgdec.c +++ b/libavformat/sbgdec.c @@ -538,6 +538,9 @@ static int parse_time_sequence(struct sbg_parser *p, int inblock) return AVERROR_INVALIDDATA; } ts.type = p->current_time.type; + + if (av_sat_add64(p->current_time.t, rel_ts) != p->current_time.t + (uint64_t)rel_ts) + return AVERROR_INVALIDDATA; ts.t = p->current_time.t + rel_ts; r = parse_fade(p, &fade); if (r < 0)