Commit fc377967 authored by Yaowu Xu's avatar Yaowu Xu

avoid operation on invalid ref_row

BUG=aomedia:718

Change-Id: Ib3fc5e83dd915d6869ee2d7e0bf40427111c6499
parent 8a8cd6b8
......@@ -116,9 +116,9 @@ static INLINE int get_level_count_mag(int *mag, const tran_low_t *tcoeffs,
for (int idx = 0; idx < nb_num; ++idx) {
const int ref_row = row + nb_offset[idx][0];
const int ref_col = col + nb_offset[idx][1];
const int pos = (ref_row << bwl) + ref_col;
if (ref_row < 0 || ref_col < 0 || ref_row >= height || ref_col >= stride)
continue;
const int pos = (ref_row << bwl) + ref_col;
tran_low_t abs_coeff = abs(tcoeffs[pos]);
count += abs_coeff > level;
if (nb_offset[idx][0] >= 0 && nb_offset[idx][1] >= 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment