[autofit] Avoid potential SEGV if running out of memory

System Internals / FreeType - Werner Lemberg [gnu.org] - 8 May 2018 09:51 EDT

Problem reported by Shailesh Mistry .

- src/autofit/afshaper.c (af_shaper_buf_create, af_shaper_buf_destroy) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Don't allocate and free a four-byte buffer. Instead, make those functions no-ops; the calling functions will provide a pointer to a buffer instead.

- src/autofit/afcjk.c (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues, af_cjk_metrics_check_digits), src/autofit/aflatin.c (af_latin_metrics_init_widths, af_latin_metrics_init_blues, af_latin_metrics_check_digits) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Use pointer to local variable for `shaper_buf'.

e0015f761 [autofit] Avoid potential SEGV if running out of memory.
ChangeLog | 29 ++++++++++++++++++++++++-----
src/autofit/afcjk.c | 40 +++++++++++++++++++++++++++++++++++-----
src/autofit/aflatin.c | 42 ++++++++++++++++++++++++++++++++++++------
src/autofit/afshaper.c | 15 ++++-----------
4 files changed, 99 insertions(+), 27 deletions(-)

Upstream: git.savannah.gnu.org


  • Share