From: James Zern Date: Wed, 18 Mar 2015 21:31:58 +0000 (-0700) Subject: vp9_mv_pred: quiet a static analysis warning X-Git-Tag: v1.4.0~17^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=428369293d7bdd0b953bc74fd925b1484f0cad20;p=libvpx vp9_mv_pred: quiet a static analysis warning add an assert to validate pred_mv array size Change-Id: I532b882b71e2baff3ac76e07ed133ec5a11bd0fc --- diff --git a/vp9/encoder/vp9_rd.c b/vp9/encoder/vp9_rd.c index caa9cae69..ae5a01226 100644 --- a/vp9/encoder/vp9_rd.c +++ b/vp9/encoder/vp9_rd.c @@ -467,6 +467,7 @@ void vp9_mv_pred(VP9_COMP *cpi, MACROBLOCK *x, pred_mv[0] = mbmi->ref_mvs[ref_frame][0].as_mv; pred_mv[1] = mbmi->ref_mvs[ref_frame][1].as_mv; pred_mv[2] = x->pred_mv[ref_frame]; + assert(num_mv_refs <= (int)(sizeof(pred_mv) / sizeof(pred_mv[0]))); // Get the sad for each candidate reference mv. for (i = 0; i < num_mv_refs; ++i) {