Fix a potential invalid memory access in non-RD coding flow

This commit fixes a potential out-of-boundary memory access due to
the use of reuse_inter_pred_sby in the non-RD coding flow. It
resolves the corresponding asan error.

Change-Id: Iff605f5921230966990013541cd855d698810922
This commit is contained in:
Jingning Han 2014-07-11 13:37:28 -07:00 committed by Gerrit Code Review
parent 3cddd81c6d
commit b957439c87
3 changed files with 3 additions and 2 deletions

View File

@ -139,5 +139,5 @@ VP9_INSTANTIATE_TEST_CASE(
CpuSpeedTest, CpuSpeedTest,
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood, ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
::libvpx_test::kRealTime), ::libvpx_test::kRealTime),
::testing::Range(0, 8)); ::testing::Range(0, 9));
} // namespace } // namespace

View File

@ -685,7 +685,7 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int rate2 = 0; int rate2 = 0;
int64_t dist2 = 0; int64_t dist2 = 0;
const int dst_stride = pd->dst.stride; const int dst_stride = cpi->sf.reuse_inter_pred_sby ? bw : pd->dst.stride;
const int src_stride = p->src.stride; const int src_stride = p->src.stride;
int block_idx = 0; int block_idx = 0;

View File

@ -296,6 +296,7 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf,
} }
if (speed >= 8) { if (speed >= 8) {
int i; int i;
sf->max_intra_bsize = BLOCK_32X32;
for (i = 0; i < BLOCK_SIZES; ++i) for (i = 0; i < BLOCK_SIZES; ++i)
sf->inter_mode_mask[i] = INTER_NEAREST; sf->inter_mode_mask[i] = INTER_NEAREST;
} }