diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-14 01:03:56 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-14 01:03:56 +0000 |
commit | a0995ee40aec246a40f00964295c2bdc09e421f8 (patch) | |
tree | 2bb892d71caf976167223d81e692319771f72860 | |
parent | fcbceee8185825b0d08aa99eacc82ed38d707aa7 (diff) | |
parent | f96c420f0d332c82cad796d54c86926d49329c12 (diff) | |
download | libvpx-android12L-d2-s7-release.tar.gz |
Snap for 7546365 from f96c420f0d332c82cad796d54c86926d49329c12 to sc-d2-releaseandroid-12.1.0_r26android-12.1.0_r25android-12.1.0_r24android-12.1.0_r23android-12.1.0_r18android-12.1.0_r17android-12.1.0_r16android-12.1.0_r15android-12.1.0_r14android-12.1.0_r13android-12.1.0_r12android12L-d2-s8-releaseandroid12L-d2-s7-releaseandroid12L-d2-s6-releaseandroid12L-d2-s5-releaseandroid12L-d2-s4-releaseandroid12L-d2-s3-releaseandroid12L-d2-s2-releaseandroid12L-d2-s1-releaseandroid12L-d2-release
Change-Id: Ifcd1d5532883348fabbb4d0a21e24f427a14e622
-rw-r--r-- | README.version | 1 | ||||
-rw-r--r-- | libvpx/vp8/encoder/ratectrl.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/README.version b/README.version index 7e8c25da3..f555bcc48 100644 --- a/README.version +++ b/README.version @@ -11,3 +11,4 @@ Local Modifications: 5e065cf9d vp8/{ratectrl,onyx_if}: fix some signed integer overflows 5eab093a7 vp9_ratectrl: fix some signed integer overflows baefbe85d Cap target bitrate to raw rate internally + 5f345a924 Avoid overflow in calc_iframe_target_size diff --git a/libvpx/vp8/encoder/ratectrl.c b/libvpx/vp8/encoder/ratectrl.c index d8d55fce2..d93fb59a4 100644 --- a/libvpx/vp8/encoder/ratectrl.c +++ b/libvpx/vp8/encoder/ratectrl.c @@ -349,8 +349,12 @@ static void calc_iframe_target_size(VP8_COMP *cpi) { } if (cpi->oxcf.rc_max_intra_bitrate_pct) { - unsigned int max_rate = - cpi->per_frame_bandwidth * cpi->oxcf.rc_max_intra_bitrate_pct / 100; + unsigned int max_rate; + // This product may overflow unsigned int + uint64_t product = cpi->per_frame_bandwidth; + product *= cpi->oxcf.rc_max_intra_bitrate_pct; + product /= 100; + max_rate = (unsigned int)VPXMIN(INT_MAX, product); if (target > max_rate) target = max_rate; } |