Context
cmap_to_fb in room/src/doom/i_video.rs dispatches between the 16-bpp and 32-bpp framebuffer paths based on s_Fb.bits_per_pixel.
C behavior
i_video.c calls I_Error for any bits_per_pixel other than 16 or 32, aborting the program.
Rust behavior
The Rust port falls through to the 32-bpp path for any value that is not 16. If bits_per_pixel is corrupted, the function writes garbage rather than crashing.
Location
room/src/doom/i_video.rs:196 (flagged with // FIXME:).
Suggested fix
After the bpp == 16 early return, panic / call the Rust equivalent of I_Error when bpp != 32.
Context
cmap_to_fbinroom/src/doom/i_video.rsdispatches between the 16-bpp and 32-bpp framebuffer paths based ons_Fb.bits_per_pixel.C behavior
i_video.ccallsI_Errorfor anybits_per_pixelother than 16 or 32, aborting the program.Rust behavior
The Rust port falls through to the 32-bpp path for any value that is not 16. If
bits_per_pixelis corrupted, the function writes garbage rather than crashing.Location
room/src/doom/i_video.rs:196(flagged with// FIXME:).Suggested fix
After the
bpp == 16early return, panic / call the Rust equivalent ofI_Errorwhenbpp != 32.