From 8154d8e2be329b1a0a145faae7d5fe0dd6aa7a7a Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Wed, 19 Apr 2023 13:48:59 -0400 Subject: [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`. --- include/freetype/internal/services/svmetric.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/freetype/internal/services/svmetric.h b/include/freetype/internal/services/svmetric.h index d067dc977..167617ebb 100644 --- a/include/freetype/internal/services/svmetric.h +++ b/include/freetype/internal/services/svmetric.h @@ -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 ); -- cgit v1.2.1