mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-10 03:34:18 +00:00
Fixes crashes when games/mods request more than MAX_MIP_LEVELS (14). Implements defensive clamping at four critical points in the texture cache (CalculateLevelSizes, CalculateMipLevelOffsets, CalculateMipLevelSizes, CalculateLevelBytes) to gracefully handle excessive mip level requests. When >14 mip levels are requested: - Logs informative warning (debug builds) - Clamps to MAX_MIP_LEVELS - Continues execution safely This improves upon Eden's solution by adding actual bounds checking instead of just converting ASSERT to ASSERT_MSG. Fixes: CTGP-DX (Mario Kart 8 Deluxe mod) Co-authored-by: JPikachu <jpikachu.eden@gmail.com> Co-authored-by: JPikachu <jpikachu@eden-emu.dev> Co-authored-by: MaranBr <maranbr@outlook.com> Signed-off-by: Zephyron <zephyron@citron-emu.org>