From 9d870f2a558f4e463e3ff953312202a8d144158b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 9 Apr 2009 13:30:26 -0400 Subject: [PATCH] =?UTF-8?q?Bug=20577952=20=E2=80=93=20Error=20loading=20{G?= =?UTF-8?q?DEF,GSUB,GPOS}=20table=200x6EAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detect TrueType Collections by checking the font data header instead of checking for "face->num_faces >1". --- src/harfbuzz-stream.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/harfbuzz-stream.c b/src/harfbuzz-stream.c index a3c3ab5eb..6d35479f6 100644 --- a/src/harfbuzz-stream.c +++ b/src/harfbuzz-stream.c @@ -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" ));