From 5a280ecde6f324de0d226261036e736e0cb49a71 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Wed, 13 May 2026 21:53:23 -0400 Subject: [PATCH] * src/truetype/ttgxvar.c (TT_Get_Var_Design): Zero extras. Fixes #1436. --- src/truetype/ttgxvar.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index d006dab83..95de8221b 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -3453,9 +3453,7 @@ TT_Face ttface = (TT_Face)face; FT_Error error = FT_Err_Ok; GX_Blend blend; - FT_MM_Var* mmvar; - FT_Var_Axis* a; - FT_UInt i, nc; + FT_UInt i; if ( !ttface->blend ) @@ -3474,31 +3472,30 @@ return error; } - nc = num_coords; if ( num_coords > blend->num_axis ) { FT_TRACE2(( "TT_Get_Var_Design:" " only using first %u of %u coordinates\n", blend->num_axis, num_coords )); - nc = blend->num_axis; + + FT_ARRAY_ZERO( coords + blend->num_axis, num_coords - blend->num_axis ); + num_coords = blend->num_axis; } - mmvar = blend->mmvar; - a = mmvar->axis; if ( ttface->doblend ) { - for ( i = 0; i < nc; i++, a++ ) + for ( i = 0; i < num_coords; i++ ) coords[i] = blend->coords[i]; } else { - for ( i = 0; i < nc; i++, a++ ) + FT_Var_Axis* a = blend->mmvar->axis; + + + for ( i = 0; i < num_coords; i++, a++ ) coords[i] = a->def; } - for ( ; i < num_coords; i++, a++ ) - coords[i] = a->def; - return FT_Err_Ok; }