diff options
author | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2009-07-03 18:01:35 +0900 |
---|---|---|
committer | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2009-07-03 18:01:35 +0900 |
commit | 34bc30a5f0b3a25d0a68a42bebcb065ab01a517a (patch) | |
tree | 17808192dc46a8bbaa4eaeb52a127c9922b12758 | |
parent | ad2badcb44b1725a60acfe8db28987cbe49b28e2 (diff) | |
download | freetype2-34bc30a5f0b3a25d0a68a42bebcb065ab01a517a.tar.gz |
truetype: Truncate the deltas of composite glyph at 16-bit values.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | src/truetype/ttgload.c | 7 |
2 files changed, 18 insertions, 2 deletions
@@ -1,5 +1,18 @@ 2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> + truetype: Truncate the deltas of composite glyph at 16-bit values. + + * src/truetype/ttgload.c (load_truetype_glyph): + Insert cast from FT_Long (deltas[i].{x,y}) to + FT_Int16 in the summation of deltas[] for composite + glyphs. Because deltas[i] is typed as FT_Pos, + its component x, y are typed as FT_Long, but + their sources are always FT_Int16 when they are + loaded by ft_var_readpackeddeltas(). However, + the limitation about the summed deltas is unclear. + +2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> + truetype: Truncate the instructions upto 16-bit per a glyph. * src/truetype/ttgload.c (TT_Hint_Glyph): Truncate diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 5d48e8fa3..b0f6810f0 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -1400,8 +1400,11 @@ { if ( subglyph->flags & ARGS_ARE_XY_VALUES ) { - subglyph->arg1 += deltas[i].x; - subglyph->arg2 += deltas[i].y; + /* XXX: overflow check for subglyph->{arg1,arg2}. */ + /* deltas[i].{x,y} must be within signed 16-bit, */ + /* but the restriction of summed delta is not clear */ + subglyph->arg1 += (FT_Int16)deltas[i].x; + subglyph->arg2 += (FT_Int16)deltas[i].y; } } |