aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-04-01 19:18:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-04-01 22:09:23 +0200
commit679a315424e6ffaafd21ebf7a86108bd4e743793 (patch)
tree98ed2a68802ac0c30ba4f35cb92149d06e8b6730
parent5f23d8b405fa24496c909f373a1b28454740ef16 (diff)
downloadffmpeg-679a315424e6ffaafd21ebf7a86108bd4e743793.tar.gz
avformat/oggparsedaala: Check duration for AV_NOPTS_VALUE
This avoids an integer overflow the solution matches oggparsevorbis.c and 45581ed15d2ad5955e24d809820c1675da68f500 Fixes: 700242 Found-by: Thomas Guilbert <tguilbert@google.com> Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/oggparsedaala.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c
index 89bda58994..ce65b2bd7a 100644
--- a/libavformat/oggparsedaala.c
+++ b/libavformat/oggparsedaala.c
@@ -232,7 +232,7 @@ static int daala_packet(AVFormatContext *s, int idx)
os->lastpts = os->lastdts = daala_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 != AV_NOPTS_VALUE)
s->streams[idx]->duration -= s->streams[idx]->start_time;
}
}