1
0
Fork 0
forked from len0rd/rockbox

fonts: Fix regression(s) caused by c23ce62.

The builtin sysfont does not have an associated buflib_alloc_data
(because it's builtin right?). font_get_{width,bits} accessed a field of
it for all fonts which crashed on some systems but not on mine.
Solution: Move this field to struct font directly.

The cache size calculated was also busted.

Fixes FS#12944 and most likely FS#12938.

Change-Id: I32303c4335a12a6c421fdca34f7ece851aac12ca
This commit is contained in:
Thomas Martitz 2014-01-26 13:56:53 +01:00
parent 8142c68bd2
commit 37be80a1a5
2 changed files with 13 additions and 17 deletions

View file

@ -107,6 +107,7 @@ struct font {
unsigned char *buffer_position; /* position in the buffer */
unsigned char *buffer_end; /* end of the buffer */
size_t buffer_size; /* size of the buffer in bytes */
bool disabled; /* font disabled (use blank as fallback if not in cache) */
#ifndef __PCTOOL__
struct font_cache cache;
uint32_t file_width_offset; /* offset to file width data */