aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2017-11-28 14:26:55 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-30 21:11:32 +0100
commit272a9687a73c44e5c27b969dd454b3e04cc32279 (patch)
treed6a690ea2cf70e243cceb1eaf86f9922945cd93d
parent9bc2f44c27a315e783a10ca59396c93f568982c0 (diff)
downloadffmpeg-272a9687a73c44e5c27b969dd454b3e04cc32279.tar.gz
Don't manipulate duration when it's AV_NOPTS_VALUE.
This leads to signed integer overflow. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit c5fd57f483d2ad8e34551b78509f1e14136f73c0) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/oggparsevp8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/oggparsevp8.c b/libavformat/oggparsevp8.c
index c534ab117d..b76ac71cc5 100644
--- a/libavformat/oggparsevp8.c
+++ b/libavformat/oggparsevp8.c
@@ -125,7 +125,7 @@ static int vp8_packet(AVFormatContext *s, int idx)
os->lastdts = vp8_gptopts(s, idx, os->granule, NULL) - duration;
if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
s->streams[idx]->start_time = os->lastpts;
- if (s->streams[idx]->duration)
+ if (s->streams[idx]->duration && s->streams[idx]->duration != AV_NOPTS_VALUE)
s->streams[idx]->duration -= s->streams[idx]->start_time;
}
}