summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/type1/t1objs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/type1/t1objs.c')
-rw-r--r--src/3rdparty/freetype/src/type1/t1objs.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/3rdparty/freetype/src/type1/t1objs.c b/src/3rdparty/freetype/src/type1/t1objs.c
index 3b918b7338..69e4fd5065 100644
--- a/src/3rdparty/freetype/src/type1/t1objs.c
+++ b/src/3rdparty/freetype/src/type1/t1objs.c
@@ -4,7 +4,7 @@
*
* Type 1 objects manager (body).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -116,11 +116,15 @@
T1_Size_Request( FT_Size t1size, /* T1_Size */
FT_Size_Request req )
{
+ FT_Error error;
+
T1_Size size = (T1_Size)t1size;
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
- FT_Request_Metrics( size->root.face, req );
+ error = FT_Request_Metrics( size->root.face, req );
+ if ( error )
+ goto Exit;
if ( funcs )
funcs->set_scale( (PSH_Globals)t1size->internal->module_data,
@@ -128,7 +132,8 @@
size->root.metrics.y_scale,
0, 0 );
- return FT_Err_Ok;
+ Exit:
+ return error;
}
@@ -141,7 +146,9 @@
FT_LOCAL_DEF( void )
T1_GlyphSlot_Done( FT_GlyphSlot slot )
{
- slot->internal->glyph_hints = NULL;
+ /* `slot->internal` might be NULL in out-of-memory situations. */
+ if ( slot->internal )
+ slot->internal->glyph_hints = NULL;
}
@@ -160,8 +167,7 @@
FT_Module module;
- module = FT_Get_Module( slot->face->driver->root.library,
- "pshinter" );
+ module = FT_Get_Module( slot->library, "pshinter" );
if ( module )
{
T1_Hints_Funcs funcs;
@@ -217,11 +223,10 @@
{
FT_FREE( face->buildchar );
- face->buildchar = NULL;
face->len_buildchar = 0;
}
- T1_Done_Blend( face );
+ T1_Done_Blend( t1face );
face->blend = NULL;
#endif
@@ -284,7 +289,8 @@
*
* @Input:
* stream ::
- * input stream where to load font data.
+ * Dummy argument for compatibility with the `FT_Face_InitFunc` API.
+ * Ignored. The stream should be passed through `face->root.stream`.
*
* face_index ::
* The index of the font face in the resource.
@@ -598,11 +604,7 @@
/* set default property values, cf. `ftt1drv.h' */
-#ifdef T1_CONFIG_OPTION_OLD_ENGINE
- driver->hinting_engine = FT_HINTING_FREETYPE;
-#else
driver->hinting_engine = FT_HINTING_ADOBE;
-#endif
driver->no_stem_darkening = TRUE;