]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[libvpx] scan-build: Fix "Result of operation is garbage or undefined" in vp9/encoder...
authorAndrey Volk <andywolk@gmail.com>
Fri, 21 Feb 2020 17:10:05 +0000 (21:10 +0400)
committerAndrey Volk <andywolk@gmail.com>
Fri, 10 Jul 2026 16:38:46 +0000 (19:38 +0300)
libs/libvpx/vp9/encoder/vp9_rd.c

index 9fa3ff186509f9e4228e1fb8dffb9da99df6bc2a..873aab318486eac616296dc425c30d9b06cdb6ff 100644 (file)
@@ -629,7 +629,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;