texture: refuse extents past 16384 texels instead of overflowing #15
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by 9hvn9yt2vk-netizen on 2026-11-23T23:02:32Z.
Layout::new checked that width, height and depth are non-zero but not that they are bounded, so values a title passes unchecked (up to u32::MAX) overflowed the size arithmetic:
offset * depthin the linear layout,slice_size * slicesand the per-mip sizes in the tiled one, and a u32 next_multiple_of in Layout::tiled. Debug builds panicked; release builds wrapped silently and returned a wrong size.Refuse anything past 16384 texels per side, the most a GFX10 image descriptor holds, so no texture the GPU can use is affected.
Found with a random-input harness (four distinct overflow sites, none left after this change).
Imported from Marvisak/VIctory. Originally posted by 9hvn9yt2vk-netizen on 2026-11-23T23:03:08Z.
loooook at thisssssss