[autofit] Fix potential memory leak.

While this doesn't show up with FreeType, exactly the same code
leaks with ttfautohint's modified auto-hinter code (which gets used
in a slightly different way).

It certainly doesn't harm since it is similar to already existing
checks in the code for embedded arrays.

* src/autofit/afhints.c (af_glyph_hints_reload): Set `max_contours'
and `max_points' for all cases.
This commit is contained in:
Werner Lemberg 2015-02-06 08:46:06 +01:00
parent 19146a5302
commit b6cb4997e8
2 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,17 @@
2015-02-06 Werner Lemberg <wl@gnu.org>
[autofit] Fix potential memory leak.
While this doesn't show up with FreeType, exactly the same code
leaks with ttfautohint's modified auto-hinter code (which gets used
in a slightly different way).
It certainly doesn't harm since it is similar to already existing
checks in the code for embedded arrays.
* src/autofit/afhints.c (af_glyph_hints_reload): Set `max_contours'
and `max_points' for all cases.
2015-01-31 Werner Lemberg <wl@gnu.org>
[autofit] Add support for Thai script.

View File

@ -615,7 +615,13 @@
old_max = hints->max_contours;
if ( new_max <= AF_CONTOURS_EMBEDDED )
hints->contours = hints->embedded.contours;
{
if ( hints->contours == NULL )
{
hints->contours = hints->embedded.contours;
hints->max_contours = AF_CONTOURS_EMBEDDED;
}
}
else if ( new_max > old_max )
{
if ( hints->contours == hints->embedded.contours )
@ -638,7 +644,13 @@
old_max = hints->max_points;
if ( new_max <= AF_POINTS_EMBEDDED )
hints->points = hints->embedded.points;
{
if ( hints->points == NULL )
{
hints->points = hints->embedded.points;
hints->max_points = AF_POINTS_EMBEDDED;
}
}
else if ( new_max > old_max )
{
if ( hints->points == hints->embedded.points )