mirror of https://git.ffmpeg.org/ffmpeg.git
prevent integer overflow in calculating duration
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
348b8218f7
commit
b79c3df088
|
@ -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
|
/* If this isn't a live stream, calculate the total duration of the
|
||||||
* stream. */
|
* stream. */
|
||||||
if (c->finished) {
|
if (c->finished) {
|
||||||
int duration = 0;
|
int64_t duration = 0;
|
||||||
for (i = 0; i < c->variants[0]->n_segments; i++)
|
for (i = 0; i < c->variants[0]->n_segments; i++)
|
||||||
duration += c->variants[0]->segments[i]->duration;
|
duration += c->variants[0]->segments[i]->duration;
|
||||||
s->duration = duration * AV_TIME_BASE;
|
s->duration = duration * AV_TIME_BASE;
|
||||||
|
|
Loading…
Reference in New Issue