Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vp9-rtc: Fix integer overflow in key frame target size
The integer overflow happens in vp9_calc_iframe_target_size_one_pass_cbr(), when calculating the target size for L1T3 encoding. The input target bitrate(kbps) is very large, so it gets set to INT_MAX (before being multiplied by 1000 to convert to bps), and avg_frame_bandwidth is then set to (INT_MAX / lc->framerate), which when multipled by (16 + kf_boost) can exceed INT_MAX. Fix is to cast the operands to int64_t and final result to int. Bug: chromium:340918567 Change-Id: Ic00094b22c1f12ca988c0cb1fcaed473e1f8ed2b
- Loading branch information