From 5946d365187dfa3ccce5ce4c8bfc50d6f32aac7f Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 18 Sep 2017 12:56:00 -0700 Subject: [PATCH] Fix out of bound tpl mv access Resolve an enc/dec mismatch issue when mv-compress is on. BUG=aomedia:746 Change-Id: Iaa79129076e6bd7215cb0448c4933a58c6241eaf --- av1/common/mvref_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c index 06999031f..39ea9fad1 100644 --- a/av1/common/mvref_common.c +++ b/av1/common/mvref_common.c @@ -345,9 +345,6 @@ static int add_tpl_ref_mv(const AV1_COMMON *cm, MV_REFERENCE_FRAME ref_frame, int blk_row, int blk_col, uint8_t *refmv_count, CANDIDATE_MV *ref_mv_stack, int16_t *mode_context) { - const TPL_MV_REF *prev_frame_mvs = cm->cur_frame->tpl_mvs + - (mi_row + blk_row) * cm->mi_stride + - (mi_col + blk_col); (void)prev_frame_mvs_base; POSITION mi_pos; int idx; @@ -365,6 +362,10 @@ static int add_tpl_ref_mv(const AV1_COMMON *cm, if (!is_inside(&xd->tile, mi_col, mi_row, cm->mi_rows, cm, &mi_pos)) return coll_blk_count; + const TPL_MV_REF *prev_frame_mvs = cm->cur_frame->tpl_mvs + + (mi_row + mi_pos.row) * cm->mi_stride + + (mi_col + mi_pos.col); + MV_REFERENCE_FRAME rf[2]; av1_set_ref_frame(rf, ref_frame); -- GitLab