From 4ee9d04bd5d518e5f1f86875f4f8184fc0552f44 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 3 Dec 2021 04:03:12 +0000 Subject: freetype 2.11.1 git-svn-id: svn://tug.org/texlive/trunk@61211 c570f23f-e606-0410-a88d-b1316a301751 --- .../libs/freetype2/freetype-src/src/psaux/t1decode.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c') diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c index ee1cb263449..7e65bde6322 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c @@ -27,8 +27,11 @@ #include "psauxerr.h" + /* ensure proper sign extension */ -#define Fix2Int( f ) ( (FT_Int)(FT_Short)( (f) >> 16 ) ) +#define Fix2Int( f ) ( (FT_Int) (FT_Short)( (f) >> 16 ) ) +#define Fix2UInt( f ) ( (FT_UInt)(FT_Short)( (f) >> 16 ) ) + /************************************************************************** * @@ -1025,16 +1028,16 @@ /* 2 24 callothersubr */ /* ==> set BuildCharArray[cvi( )] = */ { - FT_Int idx; + FT_UInt idx; PS_Blend blend = decoder->blend; if ( arg_cnt != 2 || !blend ) goto Unexpected_OtherSubr; - idx = Fix2Int( top[1] ); + idx = Fix2UInt( top[1] ); - if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) + if ( idx >= decoder->len_buildchar ) goto Unexpected_OtherSubr; decoder->buildchar[idx] = top[0]; @@ -1046,16 +1049,16 @@ /* ==> push BuildCharArray[cvi( idx )] */ /* onto T1 stack */ { - FT_Int idx; + FT_UInt idx; PS_Blend blend = decoder->blend; if ( arg_cnt != 1 || !blend ) goto Unexpected_OtherSubr; - idx = Fix2Int( top[0] ); + idx = Fix2UInt( top[0] ); - if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) + if ( idx >= decoder->len_buildchar ) goto Unexpected_OtherSubr; top[0] = decoder->buildchar[idx]; -- cgit v1.2.3