summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepa K G <deepa.kg@ittiam.com>2019-01-30 14:50:56 +0530
committerDeepa K G <deepa.kg@ittiam.com>2019-01-31 11:31:53 +0530
commit492cdb48be745a8ec69ca1b232ad98c306ae884b (patch)
treec2fd73986b1a497ee0c1c13eb45701e5d1a170e5
parent3915f0616add47d9187b679802dd757a90f2977f (diff)
downloadlibvpx-492cdb48be745a8ec69ca1b232ad98c306ae884b.tar
libvpx-492cdb48be745a8ec69ca1b232ad98c306ae884b.tar.gz
libvpx-492cdb48be745a8ec69ca1b232ad98c306ae884b.tar.bz2
libvpx-492cdb48be745a8ec69ca1b232ad98c306ae884b.zip
Fix integer overflow issue in bits allocated
When encoding at high bitrates, integer overflow occurs in the the calculation of bits allocated for layered ARF frames. Change-Id: I94ad9eea759367a222235a3b5d1c777578dc6ba9
-rw-r--r--vp9/encoder/vp9_firstpass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 8f0da48a2..7844db907 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2340,7 +2340,7 @@ static void allocate_gf_group_bits(VP9_COMP *cpi, int64_t gf_group_bits,
switch (gf_group->update_type[idx]) {
case ARF_UPDATE:
gf_group->bit_allocation[idx] =
- (int)((arf_depth_bits[gf_group->layer_depth[idx]] *
+ (int)(((int64_t)arf_depth_bits[gf_group->layer_depth[idx]] *
gf_group->gfu_boost[idx]) /
arf_depth_boost[gf_group->layer_depth[idx]]);
break;