diff options
Diffstat (limited to 'freetype/src/type42/t42objs.c')
-rw-r--r-- | freetype/src/type42/t42objs.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/freetype/src/type42/t42objs.c b/freetype/src/type42/t42objs.c index 03955e94..da1e0732 100644 --- a/freetype/src/type42/t42objs.c +++ b/freetype/src/type42/t42objs.c @@ -4,7 +4,7 @@ * * Type 42 objects manager (body). * - * Copyright (C) 2002-2021 by + * Copyright (C) 2002-2022 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, @@ -44,14 +44,8 @@ parser = &loader.parser; - if ( FT_QALLOC( face->ttf_data, 12 ) ) - goto Exit; - - /* while parsing the font we always update `face->ttf_size' so that */ - /* even in case of buggy data (which might lead to premature end of */ - /* scanning without causing an error) the call to `FT_Open_Face' in */ - /* `T42_Face_Init' passes the correct size */ - face->ttf_size = 12; + face->ttf_data = NULL; + face->ttf_size = 0; error = t42_parser_init( parser, face->root.stream, @@ -152,6 +146,11 @@ Exit: t42_loader_done( &loader ); + if ( error ) + { + FT_FREE( face->ttf_data ); + face->ttf_size = 0; + } return error; } |