Commit fb36c205a6 for aom

commit fb36c205a6e47aab9272d3fd56816bfe8dd157fe
Author: Marco Paniconi <marpan@google.com>
Date:   Wed Mar 11 10:57:15 2026 -0700

    rtc: Disable speed feature use_rtc_tf for spatial layers

    It was already disabled for resize and is_psnr_calc_enabled(),
    disable it always for now for spatial layers.

    Fixes the buffer overflow in issue below.

    Bug: 491358681
    Change-Id: If2a71249bbf07ff26e55da5905d959d6c1cdda84

diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 14b331753d..9537f0a2f8 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -1825,9 +1825,12 @@ static void set_rt_speed_feature_framesize_dependent(const AV1_COMP *const cpi,
   // temporal filtering which may change the input source during encoding:
   // this causes an issue on resized frames when psnr is calculated,
   // so disable it here for frames that are resized (encoding width/height
-  // different from configured width/height).
-  if (is_psnr_calc_enabled(cpi) && (cpi->oxcf.frm_dim_cfg.width != cm->width ||
-                                    cpi->oxcf.frm_dim_cfg.height != cm->height))
+  // different from configured width/height). Also disable for spatial layers.
+  // Bug: 491358681
+  if ((is_psnr_calc_enabled(cpi) &&
+       (cpi->oxcf.frm_dim_cfg.width != cm->width ||
+        cpi->oxcf.frm_dim_cfg.height != cm->height)) ||
+      cpi->svc.number_spatial_layers > 1)
     sf->rt_sf.use_rtc_tf = 0;

   // This speed feature is causing artifacts with active_maps enabled, so