Init max idx to find next unmapped ref buf to -1 Bug: 472285098 Change-Id: I709661ff14aa8dc47a4151349aa14806d57c513e
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c index 5ac74da..17c8ebb 100644 --- a/av1/encoder/encode_strategy.c +++ b/av1/encoder/encode_strategy.c
@@ -1142,8 +1142,8 @@ // Continue if the current ref slot is already full. if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue; // Find the next unmapped reference buffer - // in decreasing ouptut order relative to current picture. - int next_buf_max = 0; + // in decreasing output order relative to current picture. + int next_buf_max = -1; int next_disp_order = INT_MIN; for (buf_map_idx = n_bufs - 1; buf_map_idx >= 0; buf_map_idx--) { if (!buffer_map[buf_map_idx].used && @@ -1164,8 +1164,8 @@ // Continue if the current ref slot is already full. if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue; // Find the next unmapped reference buffer - // in increasing ouptut order relative to current picture. - int next_buf_max = 0; + // in increasing output order relative to current picture. + int next_buf_max = -1; int next_disp_order = INT_MAX; for (buf_map_idx = n_bufs - 1; buf_map_idx >= 0; buf_map_idx--) { if (!buffer_map[buf_map_idx].used &&