1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

prevent integer overflow in calculating duration

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
John Wimer 2011-01-17 16:00:17 +01:00 committed by Martin Storsjö
parent 348b8218f7
commit b79c3df088

View File

@ -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;