* src/autofit/aflatin.c (af_latin_hint_edges),

src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c
(af_cjk_hint_edges): Protect against division by zero.
This commit is contained in:
Werner Lemberg 2008-12-21 09:46:31 +00:00
parent 05bf6877a4
commit b6fa845146
4 changed files with 23 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2008-12-21 Hongbo Ni <hongbo@njstar.com>
* src/autofit/aflatin.c (af_latin_hint_edges),
src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c
(af_cjk_hint_edges): Protect against division by zero.
2008-12-18 Werner Lemberg <wl@gnu.org>
* docs/CHANGES: Updated.

View File

@ -1253,10 +1253,15 @@
else if ( after >= edge_limit )
af_cjk_align_serif_edge( hints, before, edge );
else
edge->pos = before->pos +
FT_MulDiv( edge->fpos - before->fpos,
after->pos - before->pos,
after->fpos - before->fpos );
{
if ( after->fpos == before->fpos )
edge->pos = before->pos;
else
edge->pos = before->pos +
FT_MulDiv( edge->fpos - before->fpos,
after->pos - before->pos,
after->fpos - before->fpos );
}
}
}
}

View File

@ -2008,7 +2008,10 @@
if ( before >= edges && before < edge &&
after < edge_limit && after > edge )
{
edge->pos = before->pos +
if ( after->opos == before->opos )
edge->pos = before->pos;
else
edge->pos = before->pos +
FT_MulDiv( edge->opos - before->opos,
after->pos - before->pos,
after->opos - before->opos );

View File

@ -2153,7 +2153,10 @@
if ( before >= edges && before < edge &&
after < edge_limit && after > edge )
{
edge->pos = before->pos +
if ( after->opos == before->opos )
edge->pos = before->pos;
else
edge->pos = before->pos +
FT_MulDiv( edge->opos - before->opos,
after->pos - before->pos,
after->opos - before->opos );