[collect_glyphs] Bail if input data looks like garbage

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
2 files changed