* src/base/ftoutln.c (ft_orientation_extremum_compute): fixing

infinite loop bug !
This commit is contained in:
David Turner 2004-01-16 08:46:11 +00:00
parent 4632fccb1b
commit 16123dfe93
1 changed files with 8 additions and 10 deletions

View File

@ -358,14 +358,11 @@
source->n_contours != target->n_contours )
return FT_Err_Invalid_Argument;
FT_ARRAY_COPY( target->points, source->points,
source->n_points );
FT_ARRAY_COPY( target->points, source->points, source->n_points );
FT_ARRAY_COPY( target->tags, source->tags,
source->n_points );
FT_ARRAY_COPY( target->tags, source->tags, source->n_points );
FT_ARRAY_COPY( target->contours, source->contours,
source->n_contours );
FT_ARRAY_COPY( target->contours, source->contours, source->n_contours );
/* copy all flags, except the `FT_OUTLINE_OWNER' one */
is_owner = target->flags & FT_OUTLINE_OWNER;
@ -680,10 +677,12 @@
first = points + extremum->first;
last = points + extremum->last;
prev = point;
next = point;
do
{
prev = ( point == first ) ? last : point - 1;
prev = ( prev == first ) ? last : prev - 1;
if ( prev == point )
return FT_ORIENTATION_TRUETYPE; /* degenerate case */
@ -691,8 +690,7 @@
do
{
next = ( point == last ) ? first : point + 1;
next = ( next == last ) ? first : next + 1;
if ( next == point )
return FT_ORIENTATION_TRUETYPE; /* shouldn't happen */