diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2018-01-21 19:21:16 +0000 |
---|---|---|
committer | John-Mark Bell <jmb@netsurf-browser.org> | 2018-01-21 19:25:51 +0000 |
commit | f3241e99a07530ef6c67bea4a011d65736649333 (patch) | |
tree | a1e3503d462a89af65adbd00b92d1ae89c3e8373 | |
parent | 30b5997d61f875591460fe0a7feda1b7f04fea66 (diff) | |
download | librufl-f3241e99a07530ef6c67bea4a011d65736649333.tar.gz librufl-f3241e99a07530ef6c67bea4a011d65736649333.tar.bz2 |
Old FontManager: ignore fonts with no mappings
Ordinarily, this shouldn't happen but, if it does, we don't want
to pollute the cache with a blank charset for the font (as we'd
prefer to rescan the font next time around in case whatever caused
it to have no mappings got fixed in the interim).
Existing caches containing blank charsets for such fonts will
remain untouched -- this is all best effort, so forcing a rescan
by bumping the cache version is not worth doing here.
-rw-r--r-- | src/rufl_init.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rufl_init.c b/src/rufl_init.c index f9ff55f..de4c4de 100644 --- a/src/rufl_init.c +++ b/src/rufl_init.c @@ -877,6 +877,13 @@ rufl_code rufl_init_scan_font_old(unsigned int font_index) } } + if (num_umaps == 0) { + /* No mappings found: font is empty or couldn't be found */ + free(umap); + free(charset); + return rufl_OK; + } + /* shrink-wrap */ charset->size = offsetof(struct rufl_character_set, block) + 32 * last_used; |