summaryrefslogtreecommitdiff
path: root/src/cff/cffgload.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2013-05-04 16:40:12 +0200
committerWerner Lemberg <wl@gnu.org>2013-05-04 16:40:12 +0200
commit94152819b0cdd134f51beb65e4dad21ba7a212ba (patch)
treee857be2c37f34f0118274e14287db85a7e8852f2 /src/cff/cffgload.c
parent138068fd0765493b1a9e9272b35c759316b9e61c (diff)
downloadfreetype2-94152819b0cdd134f51beb65e4dad21ba7a212ba.tar.gz
More fixes for clang's `sanitize' feature.
* src/base/ftcalc.c (FT_DivFix): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate, FT_Vector_Length, FT_Vector_Polarize): Ditto. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify. * src/cff/cffload.c (cff_subfont_load): Fix constant. * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed, cff_parse_fixed_dynamic): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/cid/cidload.c (cid_get_offset): Ditto. * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto.
Diffstat (limited to 'src/cff/cffgload.c')
-rw-r--r--src/cff/cffgload.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 9a151071a..0ca29d4d0 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -975,7 +975,7 @@
{
if ( ip + 1 >= limit )
goto Syntax_Error;
- val = (FT_Short)( ( (FT_UShort)ip[0] << 8 ) | ip[1] );
+ val = (FT_Short)( ( ip[0] << 8 ) | ip[1] );
ip += 2;
}
else if ( v < 247 )
@@ -996,10 +996,10 @@
{
if ( ip + 3 >= limit )
goto Syntax_Error;
- val = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |
- ( (FT_UInt32)ip[1] << 16 ) |
- ( (FT_UInt32)ip[2] << 8 ) |
- (FT_UInt32)ip[3] );
+ val = (FT_Int32)( ( ip[0] << 24 ) |
+ ( ip[1] << 16 ) |
+ ( ip[2] << 8 ) |
+ ip[3] );
ip += 4;
if ( charstring_type == 2 )
shift = 0;