[services] FT_Size_Reset_Func to return FT_Error

The `MetricsVariations` `FT_Size_Reset_Func` is currently defined to
return `void`, but the implementations return `FT_Error`. Even though
the pointers passed will be the same at runtime, calling a function
through a pointer of a different type from the original function pointer
type is undefined behavior. This may be caught at runtime by Control
Flow Integrity with something like clang's `cfi-icall`.

Issue: https://crbug.com/1433651

* include/freetype/internal/services/svmetric.h (FT_Size_Reset_Func):
return `FT_Error` instead of `void`.
This commit is contained in:
Ben Wagner 2023-04-19 13:48:59 -04:00
parent c4fe77c3f0
commit 8154d8e2be
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ FT_BEGIN_HEADER
typedef void
(*FT_Metrics_Adjust_Func)( FT_Face face );
typedef void
typedef FT_Error
(*FT_Size_Reset_Func)( FT_Size size );