[FFmpeg-cvslog] avformat/oggparsedaala: Check duration for AV_NOPTS_VALUE

Michael Niedermayer git at videolan.org
Sat Apr 1 23:55:43 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Apr  1 19:18:34 2017 +0200| [679a315424e6ffaafd21ebf7a86108bd4e743793] | committer: Michael Niedermayer

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 at google.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=679a315424e6ffaafd21ebf7a86108bd4e743793
---

 libavformat/oggparsedaala.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c
index 89bda58..ce65b2b 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;
         }
     }



More information about the ffmpeg-cvslog mailing list