[FFmpeg-cvslog] avformat/utils: avoid undefined integer overflow behavior in update_stream_timings()

Fredrik Hubinette git at videolan.org
Wed Aug 22 20:00:31 EEST 2018


ffmpeg | branch: master | Fredrik Hubinette <hubbe at google.com> | Mon Aug 20 12:59:32 2018 -0700| [5ecd580953bbed48e144c364d3cdf7ea1f3e7ddf] | committer: Michael Niedermayer

avformat/utils: avoid undefined integer overflow behavior in update_stream_timings()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/utils.c b/libavformat/utils.c
index fcd4328587..b0b5e164a6 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2666,7 +2666,7 @@ static void update_stream_timings(AVFormatContext *ic)
                 duration = FFMAX(duration, duration1);
         }
     }
-    if (start_time == INT64_MAX || (start_time > start_time_text && start_time - start_time_text < AV_TIME_BASE))
+    if (start_time == INT64_MAX || (start_time > start_time_text && start_time - (uint64_t)start_time_text < AV_TIME_BASE))
         start_time = start_time_text;
     else if (start_time > start_time_text)
         av_log(ic, AV_LOG_VERBOSE, "Ignoring outlier non primary stream starttime %f\n", start_time_text / (float)AV_TIME_BASE);



More information about the ffmpeg-cvslog mailing list