* src/sfnt/ttload.c (sfnt_dir_check): relaxed the "head" table size

verification to accept a few broken fonts who pad the size incorrectly
    (the table should be padded, but its "size" field shouldn't per se
     the spec)
This commit is contained in:
David Turner 2003-01-22 22:53:55 +00:00
parent 146ff279b4
commit 79c23ae28a
2 changed files with 12 additions and 1 deletions

View File

@ -11,6 +11,10 @@
adding a new API, named FT_Get_BDF_Property to retrieve the BDF adding a new API, named FT_Get_BDF_Property to retrieve the BDF
properties of a given PCF or BDF font properties of a given PCF or BDF font
* src/sfnt/ttload.c (sfnt_dir_check): relaxed the "head" table size
verification to accept a few broken fonts who pad the size incorrectly
(the table should be padded, but its "size" field shouldn't per se
the spec)
2003-01-18 Werner Lemberg <wl@gnu.org> 2003-01-18 Werner Lemberg <wl@gnu.org>

View File

@ -213,7 +213,14 @@
has_head = 1; has_head = 1;
if ( table.Length != 0x36 || /* the table length should be 0x36, but certain font tools
* make it 0x38, so we will just check that it is greater.
*
* note that according to the specification,
* the table must be padded to 32-bit lengths, but this doesn't
* apply to the value of its "Length" field !!
*/
if ( table.Length < 0x36 ||
FT_STREAM_SEEK( table.Offset + 12 ) || FT_STREAM_SEEK( table.Offset + 12 ) ||
FT_READ_ULONG( magic ) || FT_READ_ULONG( magic ) ||
magic != 0x5F0F3CF5UL ) magic != 0x5F0F3CF5UL )