@@ -506,15 +506,15 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
506
506
fbfont -> width , fbfont -> height , fbfont -> name );
507
507
508
508
bpc = ((fbfont -> width + 7 )/8 ) * fbfont -> height ;
509
- size = bpc * 256 ;
509
+ size = bpc * fbfont -> charcount ;
510
510
size += sizeof (struct sti_rom_font );
511
511
512
512
nf = kzalloc (size , STI_LOWMEM );
513
513
if (!nf )
514
514
return NULL ;
515
515
516
516
nf -> first_char = 0 ;
517
- nf -> last_char = 255 ;
517
+ nf -> last_char = fbfont -> charcount - 1 ;
518
518
nf -> width = fbfont -> width ;
519
519
nf -> height = fbfont -> height ;
520
520
nf -> font_type = STI_FONT_HPROMAN8 ;
@@ -525,7 +525,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
525
525
526
526
dest = nf ;
527
527
dest += sizeof (struct sti_rom_font );
528
- memcpy (dest , fbfont -> data , bpc * 256 );
528
+ memcpy (dest , fbfont -> data , bpc * fbfont -> charcount );
529
529
530
530
cooked_font = kzalloc (sizeof (* cooked_font ), GFP_KERNEL );
531
531
if (!cooked_font ) {
@@ -660,7 +660,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
660
660
void sti_font_convert_bytemode (struct sti_struct * sti , struct sti_cooked_font * f )
661
661
{
662
662
unsigned char * n , * p , * q ;
663
- int size = f -> raw -> bytes_per_char * 256 + sizeof (struct sti_rom_font );
663
+ int size = f -> raw -> bytes_per_char * ( f -> raw -> last_char + 1 ) + sizeof (struct sti_rom_font );
664
664
struct sti_rom_font * old_font ;
665
665
666
666
if (sti -> wordmode )
0 commit comments