mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2024-11-27 00:00:32 +00:00
properly array bounds check the font table (#32)
This commit is contained in:
parent
248539479d
commit
6e0cef8fa0
@ -181,8 +181,9 @@ void Font_LoadCharNES(PlayState* play, u8 codePointIndex, s32 offset) {
|
||||
|
||||
int fontIdx = codePointIndex - 0x20;
|
||||
|
||||
if (codePointIndex < 0x8B)
|
||||
if (fontIdx >= 0 && fontIdx < ARRAY_COUNT(fontTbl)) {
|
||||
memcpy(&font->charBuf[font->unk_11D88][offset], fontTbl[fontIdx], strlen(fontTbl[fontIdx]) + 1);
|
||||
}
|
||||
|
||||
// DmaMgr_SendRequest0(&font->charBuf[font->unk_11D88][offset],
|
||||
//&((u8*)SEGMENT_ROM_START(nes_font_static))[(codePointIndex - ' ') * FONT_CHAR_TEX_SIZE],
|
||||
|
Loading…
Reference in New Issue
Block a user