From 1a6617f87b12e470f5a079b950ea0a887a8d01a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 30 Aug 2026 16:36:00 +0300 Subject: [PATCH] fix(av1): finish r5's set_tile_origin sweep -- key-frame tile loop now green The two shorthand struct-init blocks r5 flagged (near decode.rs:11661/11673) already carried all four PlaneBuf fields; the actual break was the key-frame per-tile loop's own set_tile_origin(x0, y0) calls at decode.rs:4910-4912, still 2-arg after the signature grew to 4. Thread mi_col1/mi_row1 (this tile's own end, clamped to the plane's padded width/height) through as x1/y1 so the key-frame path's right/bottom reach bound matches the rest of the tree. cargo check clean. --- crates/ec-av1/src/decode.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index d5b3e7c1..3cbe7599 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -4907,9 +4907,24 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( } let mut dec = SymbolDecoder::new(tile_bytes); neighbours.start_tile(mi_row0 as usize, mi_col0 as usize, mi_col1 as usize); - y.set_tile_origin(mi_col0 as usize * 4, mi_row0 as usize * 4); - u.set_tile_origin(mi_col0 as usize * 2, mi_row0 as usize * 2); - v.set_tile_origin(mi_col0 as usize * 2, mi_row0 as usize * 2); + y.set_tile_origin( + mi_col0 as usize * 4, + mi_row0 as usize * 4, + (mi_col1 as usize * 4).min(y.width), + (mi_row1 as usize * 4).min(y.height), + ); + u.set_tile_origin( + mi_col0 as usize * 2, + mi_row0 as usize * 2, + (mi_col1 as usize * 2).min(u.width), + (mi_row1 as usize * 2).min(u.height), + ); + v.set_tile_origin( + mi_col0 as usize * 2, + mi_row0 as usize * 2, + (mi_col1 as usize * 2).min(v.width), + (mi_row1 as usize * 2).min(v.height), + ); TILE_HITS.with(|c| c.set(c.get() + 1)); for sb_r in sb_r0..sb_r1 {