Fix Savannah bug #27742.

* src/base/ftstroke.c (ft_stroker_outside): Avoid silent division by
zero, using a threshold for `theta'.
This commit is contained in:
Werner Lemberg 2009-11-20 09:33:57 +01:00
parent 934d054f45
commit a5e9dbd528
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2009-11-20 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #27742.
* src/base/ftstroke.c (ft_stroker_outside): Avoid silent division by
zero, using a threshold for `theta'.
2009-11-20 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #28036.

View File

@ -979,7 +979,8 @@
thcos = FT_Cos( theta );
sigma = FT_MulFix( stroker->miter_limit, thcos );
if ( sigma >= 0x10000L )
/* FT_Sin(x) = 0 for x <= 57 */
if ( sigma >= 0x10000L || ft_pos_abs( theta ) <= 57 )
miter = FALSE;
if ( miter ) /* this is a miter (broken angle) */
@ -1360,7 +1361,7 @@
phi1 = (angle_mid + angle_in ) / 2;
phi2 = (angle_mid + angle_out ) / 2;
length1 = FT_DivFix( stroker->radius, FT_Cos( theta1 ) );
length2 = FT_DivFix( stroker->radius, FT_Cos(theta2) );
length2 = FT_DivFix( stroker->radius, FT_Cos( theta2 ) );
for ( side = 0; side <= 1; side++ )
{