Bug 577952 – Error loading {GDEF,GSUB,GPOS} table 0x6EAD

Detect TrueType Collections by checking the font data header instead
of checking for "face->num_faces >1".
This commit is contained in:
Behdad Esfahbod 2009-04-09 13:30:26 -04:00
parent d49caf1f77
commit 9d870f2a55
1 changed files with 9 additions and 2 deletions

View File

@ -167,7 +167,7 @@ _hb_font_goto_table( HB_Font font,
{
HB_Stream stream = font->stream;
HB_UInt offset = 0;
HB_UInt offset = 0, sig;
HB_UInt count, nn;
HB_Error error;
@ -190,7 +190,14 @@ _hb_font_goto_table( HB_Font font,
* FreeType's built-in data structures
*/
if ( font->num_faces > 1 )
if ( FILE_Seek( 0 ) || ACCESS_Frame( 4 ) )
goto Exit;
sig = GET_Tag4();
FORGET_Frame();
if ( sig == HB_MAKE_TAG( 't', 't', 'c', 'f' ) )
{
/* deal with TrueType collections */
LOG(( ">> This is a TrueType Collection\n" ));