From d8292b8446b7875281a0d6fc8cb90e96b2f8d156 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 27 Apr 2022 12:38:35 -0600 Subject: [PATCH] [CFF] Fix parsing of empty Index https://github.com/harfbuzz/harfbuzz/issues/3545#issuecomment-1111047941 --- src/hb-ot-cff-common.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index c102c1517..85bbc8132 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -284,7 +284,7 @@ struct CFFIndex bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (likely ((c->check_struct (this) && count == 0) || /* empty INDEX */ + return_trace (likely ((c->check_struct (&count) && count == 0) || /* empty INDEX */ (c->check_struct (this) && offSize >= 1 && offSize <= 4 && c->check_array (offsets, offSize, count + 1) && c->check_array ((const HBUINT8*) data_base (), 1, max_offset () - 1))));