Commit ebe16056 authored by Yaowu Xu's avatar Yaowu Xu

Prevent invaid memory access

Reading second motion vector only when it has a second ref_frame

Change-Id: Ica72c1cd955832e15ceccda5e5a17b0bfcd83044
parent dbae9808
...@@ -500,7 +500,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, ...@@ -500,7 +500,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
if (is_inter_block(mbmi) && if (is_inter_block(mbmi) &&
(mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV)) { (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV)) {
int_mv best_mv[2]; int_mv best_mv[2];
for (i = 0; i < 2; ++i) for (i = 0; i < 1 + has_second_ref(mbmi); ++i)
best_mv[i].as_int = mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_int; best_mv[i].as_int = mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_int;
vp9_update_mv_count(cpi, x, best_mv); vp9_update_mv_count(cpi, x, best_mv);
} }
......
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