diff --git a/core/embed/rust/src/trezorhal/display.rs b/core/embed/rust/src/trezorhal/display.rs index 99d430fe4f..4152fbd027 100644 --- a/core/embed/rust/src/trezorhal/display.rs +++ b/core/embed/rust/src/trezorhal/display.rs @@ -12,6 +12,11 @@ pub fn backlight(val: i32) -> i32 { } pub fn get_font_info(font: i32) -> Option { + // SAFETY: + // - `ffi::get_font_info` returns either null (for invalid fonts) or a pointer to a static font_info_t struct + // - The font_info_t data is in ROM, making it immutable and static + // - The font_info_t contains pointers to static glyph data arrays also in ROM + // - All font data is generated at compile time and included in the binary unsafe { let font = ffi::get_font_info(font); Some(*font.as_ref()?)