diff mbox

[FFmpeg-devel,1/2] avformat/utils: Fix integer overflow in end time calculation in update_stream_timings()

Message ID 20180412011246.11196-1-michael@niedermayer.cc
State Accepted
Commit c48ceff786bdc96fdc64417118c457d03bd19871
Headers show

Commit Message

Michael Niedermayer April 12, 2018, 1:12 a.m. UTC
Fixes: crbug 829153

Reported-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer April 13, 2018, 8:11 p.m. UTC | #1
On Thu, Apr 12, 2018 at 03:12:45AM +0200, Michael Niedermayer wrote:
> Fixes: crbug 829153
> 
> Reported-by: Matt Wolenetz <wolenetz@google.com>
> Reviewed-by: Matt Wolenetz <wolenetz@google.com>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3e482a3bbc..f958c073b0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2648,7 +2648,7 @@  static void update_stream_timings(AVFormatContext *ic)
     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);
 
-    if (end_time == INT64_MIN || (end_time < end_time_text && end_time_text - end_time < AV_TIME_BASE)) {
+    if (end_time == INT64_MIN || (end_time < end_time_text && end_time_text - (uint64_t)end_time < AV_TIME_BASE)) {
         end_time = end_time_text;
     } else if (end_time < end_time_text) {
         av_log(ic, AV_LOG_VERBOSE, "Ignoring outlier non primary stream endtime %f\n", end_time_text / (float)AV_TIME_BASE);