[collect_glyphs] Bail if input data looks like garbage

System Internals / HarfBuzz - Behdad Esfahbod [behdad.org] - 16 December 2017 16:39 EST

Specificaly, when a range or sorted array has unexpected order, we take that as font data being garbage and bail out. This fixes significant slowdown on a bad
version of Chandas font which has a 600KB GPOS with garbage inside.

Later on, I like to add a maximum-work counter for collect_glyphs to protect against malicious fonts as well.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=794896

a7bd6d7a [collect_glyphs] Bail if input data looks like garbage
src/hb-ot-layout-common-private.hh | 14 +++++++-------
src/hb-set-private.hh | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)

Upstream: cgit.freedesktop.org

  • Share