From af727b4e629f8b07d7afb809be69d053827f6a51 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 16 Nov 2018 01:55:39 -0500 Subject: [PATCH] [hdmx] Minor --- src/hb-ot-hdmx-table.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-hdmx-table.hh b/src/hb-ot-hdmx-table.hh index 9cfce68ab..2eed85c0a 100644 --- a/src/hb-ot-hdmx-table.hh +++ b/src/hb-ot-hdmx-table.hh @@ -136,7 +136,7 @@ struct hdmx inline const DeviceRecord& operator [] (unsigned int i) const { if (unlikely (i >= numRecords)) return Null (DeviceRecord); - return StructAtOffset (&this->dataZ, i * sizeDeviceRecord); + return StructAtOffset (&this->firstDeviceRecord, i * sizeDeviceRecord); } inline bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan) @@ -200,19 +200,19 @@ struct hdmx inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && version == 0 && + return_trace (c->check_struct (this) && !hb_unsigned_mul_overflows (numRecords, sizeDeviceRecord) && sizeDeviceRecord >= DeviceRecord::min_size && c->check_range (this, get_size ())); } protected: - HBUINT16 version; /* Table version number (0) */ - HBUINT16 numRecords; /* Number of device records. */ - HBUINT32 sizeDeviceRecord; /* Size of a device record, 32-bit aligned. */ - UnsizedArrayOf dataZ; /* Array of device records. */ + HBUINT16 version; /* Table version number (0) */ + HBUINT16 numRecords; /* Number of device records. */ + HBUINT32 sizeDeviceRecord; /* Size of a device record, 32-bit aligned. */ + DeviceRecord firstDeviceRecord; /* Array of device records. */ public: - DEFINE_SIZE_ARRAY (8, dataZ); + DEFINE_SIZE_MIN (8); }; } /* namespace OT */