From 3c49a6a60a26bacfa0fc1284566db7a9c680e9c2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 27 Jun 2022 10:57:51 -0600 Subject: [PATCH] [glyf] Fix an allocation error Try fixing assertion failure found by fuzzers: hb-draw-fuzzer: ../../src/harfbuzz/src/OT/glyf/glyf.hh:175: bool OT::glyf_accelerator_t::get_points(hb_font_t *, hb_codepoint_t, T) const [T = OT::glyf_impl::path_builder_t]: Assertion `count >= glyf_impl::PHANTOM_COUNT' failed. --- src/OT/glyf/Glyph.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 6ab23c85b..956bb2d27 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -195,7 +195,7 @@ struct Glyph if (delta.x) all_points.translate (delta); } - return true; + return !all_points.in_error (); } bool get_extents (hb_font_t *font, const glyf_accelerator_t &glyf_accelerator,