diff --git a/src/cff/cffload.c b/src/cff/cffload.c index d4f1ef5ff..01d78770b 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -1497,24 +1497,23 @@ CFF_AxisCoords* axis = &varRegion->axisList[j]; - /* compute the scalar contribution of this axis; */ - /* ignore invalid ranges */ - if ( axis->startCoord > axis->peakCoord || - axis->peakCoord > axis->endCoord ) + /* compute the scalar contribution of this axis */ + /* while running mandatory range checks */ + if ( axis->peakCoord == NDV[j] || + axis->peakCoord == 0 ) continue; else if ( axis->startCoord < 0 && - axis->endCoord > 0 && - axis->peakCoord != 0 ) + axis->endCoord > 0 ) continue; - /* peak of 0 means ignore this axis */ - else if ( axis->peakCoord == 0 ) + else if ( axis->startCoord > axis->peakCoord || + axis->peakCoord > axis->endCoord ) continue; /* ignore this region if coords are out of range */ - else if ( NDV[j] < axis->startCoord || - NDV[j] > axis->endCoord ) + else if ( NDV[j] <= axis->startCoord || + NDV[j] >= axis->endCoord ) { blend->BV[master] = 0; break; @@ -1525,8 +1524,7 @@ blend->BV[master] = FT_MulDiv( blend->BV[master], NDV[j] - axis->startCoord, axis->peakCoord - axis->startCoord ); - - else if ( NDV[j] > axis->peakCoord ) + else /* NDV[j] > axis->peakCoord ) */ blend->BV[master] = FT_MulDiv( blend->BV[master], axis->endCoord - NDV[j], axis->endCoord - axis->peakCoord ); diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 886a90546..2e0cc7539 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -1077,24 +1077,23 @@ FT_Fixed ncv = ttface->blend->normalizedcoords[j]; - /* compute the scalar contribution of this axis; */ - /* ignore invalid ranges */ - if ( axis->startCoord > axis->peakCoord || - axis->peakCoord > axis->endCoord ) + /* compute the scalar contribution of this axis */ + /* while running mandatory range checks */ + if ( axis->peakCoord == ncv || + axis->peakCoord == 0 ) continue; else if ( axis->startCoord < 0 && - axis->endCoord > 0 && - axis->peakCoord != 0 ) + axis->endCoord > 0 ) continue; - /* peak of 0 means ignore this axis */ - else if ( axis->peakCoord == 0 ) + else if ( axis->startCoord > axis->peakCoord || + axis->peakCoord > axis->endCoord ) continue; /* ignore this region if coords are out of range */ - else if ( ncv < axis->startCoord || - ncv > axis->endCoord ) + else if ( ncv <= axis->startCoord || + ncv >= axis->endCoord ) { scalar = 0; break; @@ -1105,7 +1104,7 @@ scalar = FT_MulDiv( scalar, ncv - axis->startCoord, axis->peakCoord - axis->startCoord ); - else if ( ncv > axis->peakCoord ) + else /* ncv > axis->peakCoord */ scalar = FT_MulDiv( scalar, axis->endCoord - ncv, axis->endCoord - axis->peakCoord );