diff options
Diffstat (limited to 'src/3rdparty/freetype/src/base/ftgxval.c')
-rw-r--r-- | src/3rdparty/freetype/src/base/ftgxval.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/3rdparty/freetype/src/base/ftgxval.c b/src/3rdparty/freetype/src/base/ftgxval.c index 32662bed87..a65f4c879b 100644 --- a/src/3rdparty/freetype/src/base/ftgxval.c +++ b/src/3rdparty/freetype/src/base/ftgxval.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating TrueTyepGX/AAT tables (body). */ /* */ -/* Copyright 2004, 2005, 2006 by */ +/* Copyright 2004-2006, 2010, 2013, 2014 by */ /* Masatake YAMATO, Redhat K.K, */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ @@ -26,6 +26,8 @@ #include <ft2build.h> +#include FT_INTERNAL_DEBUG_H + #include FT_INTERNAL_OBJECTS_H #include FT_SERVICE_GX_VALIDATE_H @@ -44,13 +46,13 @@ if ( !face ) { - error = FT_Err_Invalid_Face_Handle; + error = FT_THROW( Invalid_Face_Handle ); goto Exit; } - if ( tables == NULL ) + if ( !tables ) { - error = FT_Err_Invalid_Argument; + error = FT_THROW( Invalid_Argument ); goto Exit; } @@ -62,7 +64,7 @@ tables, table_length ); else - error = FT_Err_Unimplemented_Feature; + error = FT_THROW( Unimplemented_Feature ); Exit: return error; @@ -73,8 +75,13 @@ FT_TrueTypeGX_Free( FT_Face face, FT_Bytes table ) { - FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Memory memory; + + + if ( !face ) + return; + memory = FT_FACE_MEMORY( face ); FT_FREE( table ); } @@ -91,13 +98,13 @@ if ( !face ) { - error = FT_Err_Invalid_Face_Handle; + error = FT_THROW( Invalid_Face_Handle ); goto Exit; } - if ( ckern_table == NULL ) + if ( !ckern_table ) { - error = FT_Err_Invalid_Argument; + error = FT_THROW( Invalid_Argument ); goto Exit; } @@ -108,7 +115,7 @@ validation_flags, ckern_table ); else - error = FT_Err_Unimplemented_Feature; + error = FT_THROW( Unimplemented_Feature ); Exit: return error; @@ -119,7 +126,13 @@ FT_ClassicKern_Free( FT_Face face, FT_Bytes table ) { - FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Memory memory; + + + if ( !face ) + return; + + memory = FT_FACE_MEMORY( face ); FT_FREE( table ); |