From 624b6802890bff686c60f289217444e4c98c62c5 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 3 Jan 2017 09:42:41 +0100 Subject: [PATCH] [sfnt] Don't fail if PCLT, EBLC (and similar tables) are invalid. These tables are optional. * src/sfnt/sfobjs.c (sfnt_load_face): Implement it. --- ChangeLog | 8 ++++++++ src/sfnt/sfobjs.c | 22 +--------------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index fef7c1e6e..780714f8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2017-01-03 Werner Lemberg + + [sfnt] Don't fail if PCLT, EBLC (and similar tables) are invalid. + + These tables are optional. + + * src/sfnt/sfobjs.c (sfnt_load_face): Implement it. + 2017-01-03 Werner Lemberg * src/cff/cffparse.c (cff_parse_num): Simplify. diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 5e7380bae..b37f144b9 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -1262,30 +1262,10 @@ /* embedded bitmap support */ if ( sfnt->load_eblc ) - { LOAD_( eblc ); - if ( error ) - { - /* a font which contains neither bitmaps nor outlines is */ - /* still valid (although rather useless in most cases); */ - /* however, you can find such stripped fonts in PDFs */ - if ( FT_ERR_EQ( error, Table_Missing ) ) - error = FT_Err_Ok; - else - goto Exit; - } - } + /* consider the pclt, kerning, and gasp tables as optional */ LOAD_( pclt ); - if ( error ) - { - if ( FT_ERR_NEQ( error, Table_Missing ) ) - goto Exit; - - face->pclt.Version = 0; - } - - /* consider the kerning and gasp tables as optional */ LOAD_( gasp ); LOAD_( kern );