From f3dad68be8ab7116b496984fb00324baa1e65d10 Mon Sep 17 00:00:00 2001 From: Tom Kacvinsky Date: Mon, 19 Mar 2001 13:52:31 +0000 Subject: [PATCH] In function parse_font_matrix(), make sure that the units per em value is assigned an unsigned short value, first by shifting right 16 bits, then by casting the results to FT_UShort. --- src/type1/t1load.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 5332000d5..bac08b111 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -894,8 +894,9 @@ /* Set Units per EM based on FontMatrix values. We set the value to */ /* 1000 / temp_scale, because temp_scale was already multiplied by */ /* 1000 (in t1_tofixed, from psobjs.c). */ - root->units_per_EM = (FT_UShort)FT_DivFix( 0x10000L, - FT_DivFix( temp_scale, 1000 ) ); + + root->units_per_EM = (FT_UShort)( FT_DivFix( 0x10000L, + FT_DivFix( temp_scale, 1000 ) ) >> 16 ); /* we need to scale the values by 1.0/temp_scale */ if ( temp_scale != 0x10000L )