this is similar to the fix for calc_iframe_target_size:
5f345a924 Avoid overflow in calc_iframe_target_size
Bug: chromium:
1264506
Change-Id: I2f0e161cf9da59ca0724692d581f1594c8098ebb
}
} else {
int percent_high = 0;
+ int64_t target = cpi->this_frame_target;
if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) &&
(cpi->buffer_level > cpi->oxcf.optimal_buffer_level)) {
percent_high = 0;
}
- cpi->this_frame_target += (cpi->this_frame_target * percent_high) / 200;
+ target += (target * percent_high) / 200;
+ target = VPXMIN(target, INT_MAX);
+ cpi->this_frame_target = (int)target;
/* Are we allowing control of active_worst_allowed_q according
* to buffer level.