From d338506ccf892b0ce489314d2d2f94c6b875368a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 30 Jun 2023 10:13:05 -0600 Subject: [PATCH] [GPOS] Reuse sanitize_values_stride_unsafe in another function --- src/OT/Layout/GPOS/ValueFormat.hh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/OT/Layout/GPOS/ValueFormat.hh b/src/OT/Layout/GPOS/ValueFormat.hh index 29a21a8fe..a6d5eb632 100644 --- a/src/OT/Layout/GPOS/ValueFormat.hh +++ b/src/OT/Layout/GPOS/ValueFormat.hh @@ -349,19 +349,11 @@ struct ValueFormat : HBUINT16 bool sanitize_values (hb_sanitize_context_t *c, const void *base, const Value *values, unsigned int count) const { TRACE_SANITIZE (this); - unsigned int len = get_len (); + unsigned size = get_size (); - if (!c->check_range (values, count, get_size ())) return_trace (false); + if (!c->check_range (values, count, size)) return_trace (false); - if (!has_device ()) return_trace (true); - - for (unsigned int i = 0; i < count; i++) { - if (!sanitize_value_devices (c, base, values)) - return_trace (false); - values += len; - } - - return_trace (true); + return_trace (sanitize_values_stride_unsafe (c, base, values, count, size)); } /* Just sanitize referenced Device tables. Doesn't check the values themselves. */