Commit 4eb5407592 for aom

commit 4eb54075920b9f0a116da2aa4a0b2f2053ad81ac
Author: Jerome Jiang <jianj@google.com>
Date:   Tue Jan 6 12:38:58 2026 -0500

    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 5ac74da648..17c8ebb151 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -1142,8 +1142,8 @@ void av1_get_ref_frames(RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
     // 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 @@ void av1_get_ref_frames(RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
     // 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 &&