Commit b40b3ddc authored by Dale Curtis's avatar Dale Curtis Committed by Michael Niedermayer

Don't manipulate duration when it's AV_NOPTS_VALUE.

This leads to signed integer overflow.
Signed-off-by: 's avatarDale Curtis <dalecurtis@chromium.org>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
(cherry picked from commit c5fd57f4)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 17bfddeb
......@@ -116,7 +116,7 @@ static int vp8_packet(AVFormatContext *s, int idx)
os->lastpts = 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;
}
}
......
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