Commit 07ab3721a1 for aom

commit 07ab3721a1efe908377891e75bd920948ca2618d
Author: James Zern <jzern@google.com>
Date:   Fri Jan 16 13:42:40 2026 -0800

    Clear a first pass motion search corner case

    This is a port from libvpx and speculative fix for b/476473849. A repro
    has not been found yet.
    dca6330a24 Clear a first pass motion search corner case

    When setting the motion search parameters, align the frame size
    to be same or above a coding block size for consistency with other
    related use cases in the encoder.

    Bug: 476473849
    Change-Id: Ib6de89c41f9e8e1569916a3167b5d1c5a63c8f1d

diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c
index a49db4aac8..0c66d7febe 100644
--- a/av1/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -256,7 +256,8 @@ static unsigned int highbd_get_prediction_error(BLOCK_SIZE bsize,
 // for first pass test.
 static int get_search_range(int width, int height) {
   int sr = 0;
-  const int dim = AOMMIN(width, height);
+  int dim = AOMMIN(width, height);
+  dim = AOMMAX(dim, MI_SIZE);

   while ((dim << sr) < MAX_FULL_PEL_VAL) ++sr;
   return sr;