summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2016-12-09 17:01:14 +0100
committerMichael Niedermayer <[email protected]>2016-12-09 17:43:47 +0100
commitee2a6f5df8c6a151c3e3826872f1b0a07401c62a (patch)
tree11aa0b2b195d465e1845190bd5904519ea64de1f
parent4413e950b26396bfb797168e4f81164a022cc6f3 (diff)
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 <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/oggdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 47a0cbae05..e1ef21337c 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -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;