we (web engine): Experimental web browser project to understand the limits of Claude

Validate data slice length before Metal texture upload

Prevents potential out-of-bounds read by checking that the data slice
is at least bytes_per_row * height before passing it to Metal's
replaceRegion:withBytes:bytesPerRow: API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+5
+5
crates/platform/src/metal.rs
··· 564 564 return None; 565 565 } 566 566 567 + let required = bytes_per_row as usize * height as usize; 568 + if data.len() < required { 569 + return None; 570 + } 571 + 567 572 let cls = class!("MTLTextureDescriptor")?; 568 573 let desc: *mut c_void = msg_send![ 569 574 cls.as_ptr(),