diff options
author | David 'Digit' Turner <digit@google.com> | 2009-06-08 15:18:21 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-06-08 15:18:21 +0200 |
commit | 77f63d23f7d380b0ff02c18fd6a154ab9063128a (patch) | |
tree | 14b8437e23a816c57512fe472fdef4c7875c2eba /src/cff/cffparse.c | |
parent | d04869994887b14ee43c9f8a9a8597193b5a7107 (diff) | |
download | android_external_freetype-77f63d23f7d380b0ff02c18fd6a154ab9063128a.tar.gz android_external_freetype-77f63d23f7d380b0ff02c18fd6a154ab9063128a.tar.bz2 android_external_freetype-77f63d23f7d380b0ff02c18fd6a154ab9063128a.zip |
Integrate FreeType 2.3.9 into the donut tree.
This is done to get fixes for a few security-related issues.
NOTE: the auto-hinter hasn't been changed to avoid modifying the rendering
of characters. The 2.3.9 code contains minor fixes (not security-related)
that could in theory do that (though extensive testing is needed to
evaluate its real impact on Android).
Diffstat (limited to 'src/cff/cffparse.c')
-rw-r--r-- | src/cff/cffparse.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c index d6d77dd..290595f 100644 --- a/src/cff/cffparse.c +++ b/src/cff/cffparse.c @@ -4,7 +4,7 @@ /* */ /* CFF token stream parser (body) */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -244,7 +244,7 @@ if ( !nib && !number ) exponent_add--; /* Only add digit if we don't overflow. */ - else if ( number < 0xCCCCCCCL ) + else if ( number < 0xCCCCCCCL && fraction_length < 9 ) { fraction_length++; number = number * 10 + nib; @@ -355,6 +355,12 @@ if ( FT_ABS( integer_length ) > 5 ) goto Exit; + /* Remove non-significant digits. */ + if ( integer_length < 0 ) { + number /= power_tens[-integer_length]; + fraction_length += integer_length; + } + /* Convert into 16.16 format. */ if ( fraction_length > 0 ) { @@ -406,10 +412,9 @@ cff_parse_fixed_scaled( FT_Byte** d, FT_Int scaling ) { - return **d == - 30 ? cff_parse_real( d[0], d[1], scaling, NULL ) - : (FT_Fixed)FT_MulFix( cff_parse_integer( d[0], d[1] ) << 16, - power_tens[scaling] ); + return **d == 30 ? cff_parse_real( d[0], d[1], scaling, NULL ) + : ( cff_parse_integer( d[0], d[1] ) * + power_tens[scaling] ) << 16; } |