shithub: libvpx

Download patch

ref: d00e68ad8789dc8bb210961532e20f0e9f6d55ae
parent: 5df4195b43e5b69572cdb1903d67d6f6c2917285
author: Jerome Jiang <[email protected]>
date: Mon Sep 20 09:37:43 EDT 2021

Cap duration to avoid overflow

Bug: webm:1728
Change-Id: Id13475660fa921e8ddcc89847e978da4c8d85886
(cherry picked from commit 09775194ffdb84b4979f3988e7ef301575b661df)

--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -4919,6 +4919,8 @@
 
       this_duration = cpi->source->ts_end - cpi->last_end_time_stamp_seen;
       last_duration = cpi->last_end_time_stamp_seen - cpi->last_time_stamp_seen;
+      // Cap this to avoid overflow of (this_duration - last_duration) * 10
+      this_duration = VPXMIN(this_duration, INT64_MAX / 10);
       /* do a step update if the duration changes by 10% */
       if (last_duration) {
         step = (int)(((this_duration - last_duration) * 10 / last_duration));