Commit 02ecda4a authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/oggparsetheora: Do not adjust AV_NOPTS_VALUE

Fixes: Chromium bug 795653
Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long'
Reported-by: 's avatarMatt Wolenetz <wolenetz@google.com>
Reviewed-by: 's avatarMatt Wolenetz <wolenetz@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8d37dd6e
......@@ -181,6 +181,7 @@ static int theora_packet(AVFormatContext *s, int idx)
if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
int seg;
int64_t pts;
duration = 1;
for (seg = os->segp; seg < os->nsegs; seg++) {
......@@ -188,7 +189,10 @@ static int theora_packet(AVFormatContext *s, int idx)
duration ++;
}
os->lastpts = os->lastdts = theora_gptopts(s, idx, os->granule, NULL) - duration;
pts = theora_gptopts(s, idx, os->granule, NULL);
if (pts != AV_NOPTS_VALUE)
pts -= duration;
os->lastpts = os->lastdts = pts;
if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
s->streams[idx]->start_time = os->lastpts;
if (s->streams[idx]->duration > 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment