[FFmpeg-cvslog] Don't manipulate duration when it's AV_NOPTS_VALUE.

Dale Curtis git at videolan.org
Tue Jan 9 02:28:24 EET 2018


ffmpeg | branch: release/3.2 | Dale Curtis <dalecurtis at chromium.org> | Tue Nov 28 14:26:55 2017 -0800| [32d16571924e442fca651902430e87c6e3bb06b3] | committer: Michael Niedermayer

Don't manipulate duration when it's AV_NOPTS_VALUE.

This leads to signed integer overflow.

Signed-off-by: Dale Curtis <dalecurtis at chromium.org>
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit c5fd57f483d2ad8e34551b78509f1e14136f73c0)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

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;
         }
     }



More information about the ffmpeg-cvslog mailing list