Lines 1098-1103
Link Here
|
1098 |
#define ERRMSG1 "[line %ld] Missing \"%s\" line.\n" |
1098 |
#define ERRMSG1 "[line %ld] Missing \"%s\" line.\n" |
1099 |
#define ERRMSG2 "[line %ld] Font header corrupted or missing fields.\n" |
1099 |
#define ERRMSG2 "[line %ld] Font header corrupted or missing fields.\n" |
1100 |
#define ERRMSG3 "[line %ld] Font glyphs corrupted or missing fields.\n" |
1100 |
#define ERRMSG3 "[line %ld] Font glyphs corrupted or missing fields.\n" |
|
|
1101 |
#define ERRMSG4 "[line %ld] BBX too big.\n" |
1101 |
|
1102 |
|
1102 |
|
1103 |
|
1103 |
static FT_Error |
1104 |
static FT_Error |
Lines 1578-1583
Link Here
|
1578 |
goto Exit; |
1579 |
goto Exit; |
1579 |
} |
1580 |
} |
1580 |
|
1581 |
|
|
|
1582 |
/* Check that the encoding is in the range [0,65536] because */ |
1583 |
/* otherwise p->have (a bitmap with static size) overflows. */ |
1584 |
if ( p->glyph_enc >= sizeof(p->have)*8 ) |
1585 |
{ |
1586 |
error = BDF_Err_Invalid_File_Format; |
1587 |
goto Exit; |
1588 |
} |
1589 |
|
1581 |
/* Check to see whether this encoding has already been encountered. */ |
1590 |
/* Check to see whether this encoding has already been encountered. */ |
1582 |
/* If it has then change it to unencoded so it gets added if */ |
1591 |
/* If it has then change it to unencoded so it gets added if */ |
1583 |
/* indicated. */ |
1592 |
/* indicated. */ |
Lines 1829-1834
Link Here
|
1829 |
/* And finally, gather up the bitmap. */ |
1838 |
/* And finally, gather up the bitmap. */ |
1830 |
if ( ft_memcmp( line, "BITMAP", 6 ) == 0 ) |
1839 |
if ( ft_memcmp( line, "BITMAP", 6 ) == 0 ) |
1831 |
{ |
1840 |
{ |
|
|
1841 |
unsigned long bitmap_size; |
1842 |
|
1832 |
if ( !( p->flags & _BDF_BBX ) ) |
1843 |
if ( !( p->flags & _BDF_BBX ) ) |
1833 |
{ |
1844 |
{ |
1834 |
/* Missing BBX field. */ |
1845 |
/* Missing BBX field. */ |
Lines 1839-1845
Link Here
|
1839 |
|
1850 |
|
1840 |
/* Allocate enough space for the bitmap. */ |
1851 |
/* Allocate enough space for the bitmap. */ |
1841 |
glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3; |
1852 |
glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3; |
1842 |
glyph->bytes = (unsigned short)( glyph->bpr * glyph->bbx.height ); |
1853 |
|
|
|
1854 |
bitmap_size = glyph->bpr * glyph->bbx.height; |
1855 |
if ( bitmap_size > 0xFFFFU ) |
1856 |
{ |
1857 |
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG4, lineno )); |
1858 |
error = BDF_Err_Bbx_Too_Big; |
1859 |
goto Exit; |
1860 |
} |
1861 |
else |
1862 |
glyph->bytes = (unsigned short)bitmap_size; |
1843 |
|
1863 |
|
1844 |
if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes ) ) |
1864 |
if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes ) ) |
1845 |
goto Exit; |
1865 |
goto Exit; |