mirror of
https://github.com/kaesaecracker/servicepoint-simulator.git
synced 2025-01-18 02:20:14 +01:00
fix out of bounds read
This commit is contained in:
parent
9ea79a370f
commit
43b096bd69
|
@ -10,7 +10,7 @@ use servicepoint::{Grid, PixelGrid, TILE_SIZE};
|
|||
const DEFAULT_FONT_FILE: &[u8] = include_bytes!("../Web437_IBM_BIOS.woff");
|
||||
|
||||
pub struct BitmapFont {
|
||||
bitmaps: [PixelGrid; u8::MAX as usize],
|
||||
bitmaps: [PixelGrid; u8::MAX as usize + 1],
|
||||
}
|
||||
|
||||
impl BitmapFont {
|
||||
|
@ -18,7 +18,7 @@ impl BitmapFont {
|
|||
let mut bitmaps =
|
||||
core::array::from_fn(|_| PixelGrid::new(TILE_SIZE, TILE_SIZE));
|
||||
|
||||
for char_code in u8::MIN..u8::MAX {
|
||||
for char_code in u8::MIN..=u8::MAX {
|
||||
let char = char_code as char;
|
||||
let glyph_id = match font.glyph_for_char(char) {
|
||||
None => continue,
|
||||
|
|
Loading…
Reference in a new issue