diff options
author | Jorge E. Moreira <jemoreira@google.com> | 2020-05-08 15:23:48 -0700 |
---|---|---|
committer | Jorge Moreira Broche <jemoreira@google.com> | 2020-05-11 21:29:18 +0000 |
commit | b6fa0f20565ce10b4724a120ff0c8d6faff0926b (patch) | |
tree | 0870ef18eccc65dfbb8034dd33776ebd092b72ef /examples.mk | |
parent | 2d0f3b23a908bb54dbeddf6d1dcc666600470e2e (diff) | |
download | libvpx-b6fa0f20565ce10b4724a120ff0c8d6faff0926b.tar libvpx-b6fa0f20565ce10b4724a120ff0c8d6faff0926b.tar.gz libvpx-b6fa0f20565ce10b4724a120ff0c8d6faff0926b.tar.bz2 libvpx-b6fa0f20565ce10b4724a120ff0c8d6faff0926b.zip |
Temporarily convert to 64 bits to avoid overflows
In the vp8_cost_branch function a couple of unsigned int are being
multiplied by integer coefficients and added to later be divided by
256. While the end result most likely fits an unsigned int, the
intermediary result of multiplying and adding sometimes doesn't (I was
able to reproduce it by leaving the encoder running at 60 fps for a
while). To avoid the multiplication overflow (which is undefined
behavior and causes a wrong result anyways) the calculation is
performed using unsigned long long instead and cast to unsigned int
for return.
Bug: b/154172422
Test: run cuttlefish with webrtc enabled for an hour
Change-Id: If7ebbda38b2450a59ed3c99ffbb59dc62431a324
Diffstat (limited to 'examples.mk')
0 files changed, 0 insertions, 0 deletions