Allow loading FRF fonts up to 0x20000 bytes

This commit is contained in:
Pk11 2021-09-01 15:13:44 -05:00 committed by d0k3
parent 942e67e507
commit 1ffbca7d46

View File

@ -2056,9 +2056,9 @@ u32 FileHandlerMenu(char* current_path, u32* cursor, u32* scroll, PaneData** pan
return 0; return 0;
} }
else if (user_select == font) { // set font else if (user_select == font) { // set font
u8* font = (u8*) malloc(0x10000); // arbitrary, should be enough by far u8* font = (u8*) malloc(0x20000); // arbitrary, should be enough by far
if (!font) return 1; if (!font) return 1;
u32 font_size = FileGetData(file_path, font, 0x10000, 0); u32 font_size = FileGetData(file_path, font, 0x20000, 0);
if (font_size) SetFont(font, font_size); if (font_size) SetFont(font, font_size);
ClearScreenF(true, true, COLOR_STD_BG); ClearScreenF(true, true, COLOR_STD_BG);
free(font); free(font);
@ -2324,9 +2324,9 @@ u32 GodMode(int entrypoint) {
// custom font handling // custom font handling
if (CheckSupportFile("font.frf")) { if (CheckSupportFile("font.frf")) {
u8* riff = (u8*) malloc(0x10000); // arbitrary, should be enough by far u8* riff = (u8*) malloc(0x20000); // arbitrary, should be enough by far
if (riff) { if (riff) {
u32 riff_size = LoadSupportFile("font.frf", riff, 0x10000); u32 riff_size = LoadSupportFile("font.frf", riff, 0x20000);
if (riff_size) SetFont(riff, riff_size); if (riff_size) SetFont(riff, riff_size);
free(riff); free(riff);
} }