ref: 0d51a97ae9b35faaffc1c32f6fd6b16897172e69
parent: fa53008fb739f2ce64a391552cc50804321683c1
parent: bc7074508a3d0d877fadee02fb2027347f4a9c04
author: James Zern <[email protected]>
date: Wed Jun 17 01:29:30 EDT 2015
Merge "Fix integer overflow issue in rtc coding flow intra mode search"
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -658,7 +658,8 @@
block = 0;
*rate = 0;
*dist = 0;
- *sse = (*sse << 6) >> shift;
+ if (*sse < INT64_MAX)
+ *sse = (*sse << 6) >> shift;
for (r = 0; r < max_blocks_high; r += block_step) {
for (c = 0; c < num_4x4_w; c += block_step) {
if (c < max_blocks_wide) {
@@ -912,6 +913,8 @@
// TODO(jingning): This needs further refactoring.
block_yrd(cpi, x, &rate, &dist, &is_skippable, &this_sse, 0,
bsize_tx, MIN(tx_size, TX_16X16));
+ // this_sse is a dummy variable here. Its value should remain INT64_MAX.
+ assert(this_sse == INT64_MAX);
x->skip_txfm[0] = is_skippable;
rate += vp9_cost_bit(vp9_get_skip_prob(&cpi->common, xd), is_skippable);