Commit b79c3df0 authored by John Wimer's avatar John Wimer Committed by Martin Storsjö
Browse files

prevent integer overflow in calculating duration


Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 348b8218
......@@ -306,7 +306,7 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
/* If this isn't a live stream, calculate the total duration of the
* stream. */
if (c->finished) {
int duration = 0;
int64_t duration = 0;
for (i = 0; i < c->variants[0]->n_segments; i++)
duration += c->variants[0]->segments[i]->duration;
s->duration = duration * AV_TIME_BASE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment