diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 3ba8ef9b68..dc310c0ad1 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3369,6 +3369,8 @@ static int64_t webm_dash_manifest_compute_bandwidth(AVFormatContext *s, int64_t // prebuffered. pre_bytes = desc_end.end_offset - desc_end.start_offset; pre_ns = desc_end.end_time_ns - desc_end.start_time_ns; + if (pre_ns <= 0) + return -1; pre_sec = pre_ns / nano_seconds_per_second; prebuffer_bytes += pre_bytes * ((temp_prebuffer_ns / nano_seconds_per_second) / pre_sec);