Use av_sat_sub64() when updating pts by duration.
authorDale Curtis <dalecurtis@chromium.org>
Thu, 14 May 2020 21:33:55 +0000 (14:33 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 29 May 2020 17:40:36 +0000 (19:40 +0200)
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/oggparsetheora.c

index 87a676f..c481a79 100644 (file)
@@ -191,7 +191,7 @@ static int theora_packet(AVFormatContext *s, int idx)
 
         pts = theora_gptopts(s, idx, os->granule, NULL);
         if (pts != AV_NOPTS_VALUE)
-            pts -= duration;
+            pts = av_sat_sub64(pts, duration);
         os->lastpts = os->lastdts = pts;
         if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
             s->streams[idx]->start_time = os->lastpts;