Fix a bug that can cause large fonts to not be read correctly.
This commit is contained in:
parent
7826664969
commit
9500ed2bcc
@ -63,7 +63,7 @@ struct mf_bwfont_s
|
||||
const uint8_t version;
|
||||
|
||||
/* Number of character ranges. */
|
||||
const uint8_t char_range_count;
|
||||
const uint16_t char_range_count;
|
||||
|
||||
/* Array of the character ranges */
|
||||
const struct mf_bwfont_char_range_s *char_ranges;
|
||||
|
@ -46,7 +46,7 @@ static const uint8_t *find_glyph(const struct mf_rlefont_s *font,
|
||||
index = character - range->first_char;
|
||||
if (character >= range->first_char && index < range->char_count)
|
||||
{
|
||||
uint16_t offset = range->glyph_offsets[index];
|
||||
unsigned offset = range->glyph_offsets[index];
|
||||
return &range->glyph_data[offset];
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ struct mf_rlefont_s
|
||||
const uint8_t dict_entry_count;
|
||||
|
||||
/* Number of discontinuous character ranges */
|
||||
const uint8_t char_range_count;
|
||||
const uint16_t char_range_count;
|
||||
|
||||
/* Array of the character ranges */
|
||||
const struct mf_rlefont_char_range_s *char_ranges;
|
||||
|
Loading…
Reference in New Issue
Block a user