vp9: Fix multiplication overflow
authorMikko Koivisto <mikko.koivisto@unikie.com>
Mon, 15 Nov 2021 18:47:05 +0000 (18:47 +0000)
committerMikko Koivisto <mikko.koivisto@unikie.com>
Tue, 16 Nov 2021 05:32:39 +0000 (05:32 +0000)
commit9fb780c5e75584fe198a89f0cf1898cebb542104
treea4658b589ed56e8764132ca37091082a5b63740c
parent2d2637547d7ee5f89cb1f6bfd1956b5ad8e29b77
vp9: Fix multiplication overflow

Fix UBSan error reported from aosp Cuttlefish device:
/vp9/encoder/vp9_ratectrl.c:238:33: unsigned integer overflow:
2500000 * 1800 cannot be represented in type 'unsigned int'

...by casting the operand and the result of multiplication
to 64bit integer.

Test: vp9 webrtc streaming with Cuttlefish
Change-Id: Id5bb3d4071a96179caffae0829d3cc4e48c7614b
vp9/encoder/vp9_ratectrl.c