Fix an out of bounds issue
Fixed an out of bounds issue for cand array.
BUG=aomedia:2641
Change-Id: I74dcd9c60029f6e3a5d10630b655812cd483f76f
diff --git a/av1/encoder/motion_search_facade.c b/av1/encoder/motion_search_facade.c
index 52f4850..f9b0ea4 100644
--- a/av1/encoder/motion_search_facade.c
+++ b/av1/encoder/motion_search_facade.c
@@ -124,8 +124,10 @@
else
start_mv = get_fullmv_from_mv(&ref_mv);
- cand_mv_t cand[MAX_MC_FLOW_BLK_IN_SB * MAX_MC_FLOW_BLK_IN_SB] = { { { 0, 0 },
- 0 } };
+ // cand stores start_mv and all possible MVs in a SB.
+ cand_mv_t cand[MAX_MC_FLOW_BLK_IN_SB * MAX_MC_FLOW_BLK_IN_SB + 1] = {
+ { { 0, 0 }, 0 }
+ };
cand[0].fmv = start_mv;
int cnt = 1;
int total_weight = 0;