diff options
Diffstat (limited to 'freetype/src/sfnt/sfdriver.c')
-rw-r--r-- | freetype/src/sfnt/sfdriver.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/freetype/src/sfnt/sfdriver.c b/freetype/src/sfnt/sfdriver.c index b74679b31..247aa6799 100644 --- a/freetype/src/sfnt/sfdriver.c +++ b/freetype/src/sfnt/sfdriver.c @@ -4,7 +4,7 @@ /* */ /* High-level SFNT driver interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ +/* Copyright 1996-2007, 2009-2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -117,15 +117,20 @@ FT_ULong *offset, FT_ULong *length ) { - if ( !tag || !offset || !length ) + if ( !offset || !length ) return SFNT_Err_Invalid_Argument; - if ( idx >= face->num_tables ) - return SFNT_Err_Table_Missing; + if ( !tag ) + *length = face->num_tables; + else + { + if ( idx >= face->num_tables ) + return SFNT_Err_Table_Missing; - *tag = face->dir_tables[idx].Tag; - *offset = face->dir_tables[idx].Offset; - *length = face->dir_tables[idx].Length; + *tag = face->dir_tables[idx].Tag; + *offset = face->dir_tables[idx].Offset; + *length = face->dir_tables[idx].Length; + } return SFNT_Err_Ok; } |