From 88ee4182d89842c504d766e827a1338b67cfef07 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 21 Feb 2020 21:10:05 +0400 Subject: [PATCH] [libvpx] scan-build: Fix "Result of operation is garbage or undefined" in vp9/encoder/vp9_rd.c --- libs/libvpx/vp9/encoder/vp9_rd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libvpx/vp9/encoder/vp9_rd.c b/libs/libvpx/vp9/encoder/vp9_rd.c index 34c74424ce..b874a32dd7 100644 --- a/libs/libvpx/vp9/encoder/vp9_rd.c +++ b/libs/libvpx/vp9/encoder/vp9_rd.c @@ -589,7 +589,7 @@ void vp9_mv_pred(VP9_COMP *cpi, MACROBLOCK *x, uint8_t *ref_y_buffer, x->mbmi_ext->ref_mvs[ref_frame][1].as_int; // Get the sad for each candidate reference mv. - for (i = 0; i < num_mv_refs; ++i) { + for (i = 0; i < num_mv_refs && i < MAX_MV_REF_CANDIDATES + 1; ++i) { const MV *this_mv = &pred_mv[i]; int fp_row, fp_col; if (this_mv->row == INT16_MAX || this_mv->col == INT16_MAX) continue;