avformat/oggdec: Skip streams in duration correction that did not had their duration set.

Fixes: part of 670190.ogg
Fixes integer overflow

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-12-09 17:01:14 +01:00
parent 4413e950b2
commit ee2a6f5df8
1 changed files with 2 additions and 0 deletions

View File

@ -643,6 +643,8 @@ static int ogg_get_length(AVFormatContext *s)
int64_t pts;
if (i < 0) continue;
pts = ogg_calc_pts(s, i, NULL);
if (s->streams[i]->duration == AV_NOPTS_VALUE)
continue;
if (pts != AV_NOPTS_VALUE && s->streams[i]->start_time == AV_NOPTS_VALUE && !ogg->streams[i].got_start) {
s->streams[i]->duration -= pts;
ogg->streams[i].got_start= 1;