From 3a78cf92c83c6f05154e42e8f7b17bd8bc93f1d6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Mar 2022 12:56:44 -0600 Subject: [PATCH] [gvar] Fix decoding of private vs shared points Fixes https://github.com/harfbuzz/harfbuzz/issues/3506 --- src/hb-ot-var-gvar-table.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh index 539213c33..618cec08f 100644 --- a/src/hb-ot-var-gvar-table.hh +++ b/src/hb-ot-var-gvar-table.hh @@ -577,10 +577,11 @@ struct gvar hb_bytes_t bytes ((const char *) p, length); hb_vector_t private_indices; - if (iterator.current_tuple->has_private_points () && + bool has_private_points = iterator.current_tuple->has_private_points (); + if (has_private_points && !GlyphVariationData::unpack_points (p, private_indices, bytes)) return false; - const hb_array_t &indices = private_indices.length ? private_indices : shared_indices; + const hb_array_t &indices = has_private_points ? private_indices : shared_indices; bool apply_to_all = (indices.length == 0); unsigned int num_deltas = apply_to_all ? points.length : indices.length;