[ot] Fix VariationStore evaluation algorithm

Ouch!  Missing coords should still be evaluated as coord=0, which
most of the time results in a factor of 0.  We were skipping these,
which was equivalent to a factor of 1.

Fixes https://github.com/harfbuzz/harfbuzz/issues/652
This commit is contained in:
Behdad Esfahbod 2018-01-05 13:20:21 +00:00
parent a3afdd1e08
commit 54b2b93722
1 changed files with 3 additions and 2 deletions

View File

@ -1275,10 +1275,11 @@ struct VarRegionList
const VarRegionAxis *axes = axesZ + (region_index * axisCount);
float v = 1.;
unsigned int count = MIN (coord_len, (unsigned int) axisCount);
unsigned int count = axisCount;
for (unsigned int i = 0; i < count; i++)
{
float factor = axes[i].evaluate (coords[i]);
int coord = i < coord_len ? coords[i] : 0;
float factor = axes[i].evaluate (coord);
if (factor == 0.)
return 0.;
v *= factor;