Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure nb_bitmap_char is initialized #425

Merged
merged 2 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bolos/cx_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef NATIVE_64BITS // NO 64BITS
/** 64bits types, native or by-hands, depending on target and/or compiler
* support.
* This type is defined here only because sha-3 struct used it INTENALLY.
* This type is defined here only because sha-3 struct used it INTERNALLY.
* It should never be directly used by other modules.
*/
struct uint64_s {
Expand Down
5 changes: 5 additions & 0 deletions src/bolos/fonts_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ void parse_fonts(void *code, unsigned long text_load_addr,
nb_fonts = fonts_size / 4;
}

// There is no font or we don't know its format
if (!nb_fonts) {
return;
}

// Checks that fonts & nb_fonts are coherent
if (fonts[nb_fonts] != nb_fonts) {
fprintf(stdout, "ERROR: Expecting nb_fonts=%u and found %u instead!\n",
Expand Down
6 changes: 2 additions & 4 deletions src/launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,8 @@ static int run_app(char *name, unsigned long *parameters)
app = get_current_app();

// Parse fonts and build bitmap -> character table
if ((app->elf.fonts_addr != 0) || (hw_model == MODEL_STAX)) {
parse_fonts(memory.code, app->elf.text_load_addr, app->elf.fonts_addr,
app->elf.fonts_size);
}
parse_fonts(memory.code, app->elf.text_load_addr, app->elf.fonts_addr,
app->elf.fonts_size);

/* thumb mode */
f = (void *)((unsigned long)p | 1);
Expand Down
Loading