[name]
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 2 May 2019 21:42:37 +0000 (14:42 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 2 May 2019 21:43:22 +0000 (14:43 -0700)
src/hb-ot-name-table.hh

index c8b38a6..a15981c 100644 (file)
@@ -98,8 +98,7 @@ struct NameRecord
   bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
-    /* We can check from base all the way up to the end of string... */
-    return_trace (c->check_struct (this) && c->check_range ((char *) base, (unsigned int) length + offset));
+    return_trace (c->check_struct (this) && offset.sanitize (c, base, length));
   }
 
   HBUINT16     platformID;     /* Platform ID. */
@@ -107,7 +106,8 @@ struct NameRecord
   HBUINT16     languageID;     /* Language ID. */
   HBUINT16     nameID;         /* Name ID. */
   HBUINT16     length;         /* String length (in bytes). */
-  HBUINT16     offset;         /* String offset from start of storage area (in bytes). */
+  OffsetTo<UnsizedArrayOf<HBUINT8>>
+               offset;         /* String offset from start of storage area (in bytes). */
   public:
   DEFINE_SIZE_STATIC (12);
 };