From 47124e6337dea130c9e7312c293dd00d1b348e89 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 24 Feb 2025 23:25:02 -0700 Subject: [PATCH] [VARC] Avoid creating cache if there's no VARC table --- src/OT/Var/VARC/VARC.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OT/Var/VARC/VARC.hh b/src/OT/Var/VARC/VARC.hh index bc6dcc04f..f88339219 100644 --- a/src/OT/Var/VARC/VARC.hh +++ b/src/OT/Var/VARC/VARC.hh @@ -160,6 +160,8 @@ struct VARC bool get_path (hb_font_t *font, hb_codepoint_t gid, hb_draw_session_t &draw_session) const { + if (!table->has_data ()) return false; + hb_glyf_scratch_t *scratch; // Borrow the cached strach buffer. @@ -193,6 +195,8 @@ struct VARC hb_atomic_ptr_t cached_scratch; }; + bool has_data () const { return version.major != 0; } + protected: FixedVersion<> version; /* Version identifier */ Offset32To coverage;