summaryrefslogtreecommitdiff
path: root/src/sfnt/ttbdf.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2023-05-06 23:59:25 +0200
committerWerner Lemberg <wl@gnu.org>2023-05-07 14:59:50 +0200
commite245951c43c9d69cd6e508190bf00f29f47ccbc6 (patch)
tree9bf65b24b6d79dde35b17606832a555969d388ac /src/sfnt/ttbdf.c
parentceba488cf8366a71db4aac9b2c623746b086e62b (diff)
downloadfreetype2-e245951c43c9d69cd6e508190bf00f29f47ccbc6.tar.gz
* src/sfnt/sfdriver.c, src/sfnt/ttbdf.c: Clean up interface.
Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests. * src/sfnt/sfdriver.c (sfnt_load_table): New wrapper function. (sfnt_service_sfnt_table): Use it.
Diffstat (limited to 'src/sfnt/ttbdf.c')
-rw-r--r--src/sfnt/ttbdf.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sfnt/ttbdf.c b/src/sfnt/ttbdf.c
index c4d0035ea..536fa7467 100644
--- a/src/sfnt/ttbdf.c
+++ b/src/sfnt/ttbdf.c
@@ -136,13 +136,14 @@
FT_LOCAL_DEF( FT_Error )
- tt_face_find_bdf_prop( TT_Face face,
+ tt_face_find_bdf_prop( FT_Face face, /* TT_Face */
const char* property_name,
BDF_PropertyRec *aprop )
{
- TT_BDF bdf = &face->bdf;
- FT_Size size = FT_FACE( face )->size;
- FT_Error error = FT_Err_Ok;
+ TT_Face ttface = (TT_Face)face;
+ TT_BDF bdf = &ttface->bdf;
+ FT_Size size = FT_FACE_SIZE( face );
+ FT_Error error = FT_Err_Ok;
FT_Byte* p;
FT_UInt count;
FT_Byte* strike;
@@ -153,7 +154,7 @@
if ( bdf->loaded == 0 )
{
- error = tt_face_load_bdf_props( face, FT_FACE( face )->stream );
+ error = tt_face_load_bdf_props( ttface, FT_FACE_STREAM( face ) );
if ( error )
goto Exit;
}