avformat/oggdec: Skip streams in duration correction that did not had their duration...
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 9 Dec 2016 16:01:14 +0000 (17:01 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 9 Dec 2016 16:46:10 +0000 (17:46 +0100)
Fixes: part of 670190.ogg
Fixes integer overflow

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ee2a6f5df8c6a151c3e3826872f1b0a07401c62a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/oggdec.c

index 8f3b44c..7ecb42c 100644 (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;