summaryrefslogtreecommitdiff
path: root/src/rufl_init.c
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-05-22 21:39:33 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-05-22 21:42:04 +0100
commit7b1ee98c53be125756b16d35cbd2b8c9f4ffbe15 (patch)
treeb338065c4637cc5bcb8d91ebf7fc2fc424f36041 /src/rufl_init.c
parente58ebde8498df388975cf050382e4e9aadf2f050 (diff)
downloadlibrufl-7b1ee98c53be125756b16d35cbd2b8c9f4ffbe15.tar.gz
librufl-7b1ee98c53be125756b16d35cbd2b8c9f4ffbe15.tar.bz2
Add test for fonts with no encodings at all
This exposed a failure to clean up any FontManager error occurring when attempting to load this kind of font. Additionally, it also exposed a failure to initialise the umap count in an internal structure. This was probably harmless in reality, but caused the test to fail.
Diffstat (limited to 'src/rufl_init.c')
-rw-r--r--src/rufl_init.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rufl_init.c b/src/rufl_init.c
index 748c306..b7f4042 100644
--- a/src/rufl_init.c
+++ b/src/rufl_init.c
@@ -364,6 +364,7 @@ rufl_code rufl_init_add_font(const char *identifier, const char *local_name)
return rufl_OUT_OF_MEMORY;
rufl_font_list[rufl_font_list_entries].charset = NULL;
rufl_font_list[rufl_font_list_entries].umap = NULL;
+ rufl_font_list[rufl_font_list_entries].num_umaps = 0;
rufl_font_list_entries++;
/* determine family, weight, and slant */
@@ -891,6 +892,7 @@ rufl_code rufl_init_scan_font_old(unsigned int font_index)
error_FONT_TOO_MANY_CHUNKS)) {
/* Ensure we reuse the currently allocated umap */
num_umaps--;
+ rufl_fm_error = NULL;
} else if (code != rufl_OK) {
LOG("rufl_init_scan_font_in_encoding(\"%s\", \"%s\", "
"...): 0x%x (0x%x: %s)",
@@ -957,6 +959,7 @@ rufl_code rufl_init_scan_font_old(unsigned int font_index)
error_FONT_TOO_MANY_CHUNKS)) {
/* Ensure we reuse the currently allocated umap */
num_umaps--;
+ rufl_fm_error = NULL;
} else if (code != rufl_OK) {
LOG("rufl_init_scan_font_in_encoding(\"%s\", NULL, "
"...): 0x%x (0x%x: %s)",