[truetype] Fix degenerate case in S{P,F,DP}VTL opcodes.
* src/truetype/ttinterp.c (Ins_SxVTL): Handle p1 == p2 specially. (Ins_SDPVTL): Handle v1 == v2 specially.
This commit is contained in:
parent
b91e785308
commit
bad0160c16
|
@ -1,3 +1,10 @@
|
|||
2011-08-12 Werner Lemberg <wl@gnu.org
|
||||
|
||||
[truetype] Fix degenerate case in S{P,F,DP}VTL opcodes.
|
||||
|
||||
* src/truetype/ttinterp.c (Ins_SxVTL): Handle p1 == p2 specially.
|
||||
(Ins_SDPVTL): Handle v1 == v2 specially.
|
||||
|
||||
2011-08-09 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Fix Savannah bug #33975.
|
||||
|
|
|
@ -2845,6 +2845,17 @@
|
|||
A = p1->x - p2->x;
|
||||
B = p1->y - p2->y;
|
||||
|
||||
/* If p1 == p2, SPVTL and SFVTL behave the same as */
|
||||
/* SPVTCA[X] and SFVTCA[X], respectively. */
|
||||
/* */
|
||||
/* Confirmed by Greg Hitchcock. */
|
||||
|
||||
if ( A == 0 && B == 0 )
|
||||
{
|
||||
A = 0x4000;
|
||||
aOpc = 0;
|
||||
}
|
||||
|
||||
if ( ( aOpc & 1 ) != 0 )
|
||||
{
|
||||
C = B; /* counter clockwise rotation */
|
||||
|
@ -5181,7 +5192,8 @@
|
|||
Ins_SDPVTL( INS_ARG )
|
||||
{
|
||||
FT_Long A, B, C;
|
||||
FT_UShort p1, p2; /* was FT_Int in pas type ERROR */
|
||||
FT_UShort p1, p2; /* was FT_Int in pas type ERROR */
|
||||
FT_Int aOpc = CUR.opcode;
|
||||
|
||||
|
||||
p1 = (FT_UShort)args[1];
|
||||
|
@ -5202,9 +5214,20 @@
|
|||
|
||||
A = v1->x - v2->x;
|
||||
B = v1->y - v2->y;
|
||||
|
||||
/* If v1 == v2, SDPVTL behaves the same as */
|
||||
/* SVTCA[X], respectively. */
|
||||
/* */
|
||||
/* Confirmed by Greg Hitchcock. */
|
||||
|
||||
if ( A == 0 && B == 0 )
|
||||
{
|
||||
A = 0x4000;
|
||||
aOpc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( CUR.opcode & 1 ) != 0 )
|
||||
if ( ( aOpc & 1 ) != 0 )
|
||||
{
|
||||
C = B; /* counter clockwise rotation */
|
||||
B = A;
|
||||
|
@ -5222,7 +5245,7 @@
|
|||
B = v1->y - v2->y;
|
||||
}
|
||||
|
||||
if ( ( CUR.opcode & 1 ) != 0 )
|
||||
if ( ( aOpc & 1 ) != 0 )
|
||||
{
|
||||
C = B; /* counter clockwise rotation */
|
||||
B = A;
|
||||
|
|
Loading…
Reference in New Issue