public:
inline bool sanitize (SANITIZE_ARG_DEF, void *base) {
TRACE_SANITIZE ();
- if (!(SANITIZE_SELF () && SANITIZE_ARRAY (tableDir, TableDirectory::get_size (), numTables))) return false;
- return true;
- /* No need to check tables individually since we don't sanitize the
- * referenced table, just the table directory. Code retaind to make
- * sure TableDirectory has a baseless sanitize(). */
- unsigned int count = numTables;
- for (unsigned int i = 0; i < count; i++)
- if (!SANITIZE (tableDir[i]))
- return false;
- return true;
+ return SANITIZE_SELF () && SANITIZE_ARRAY (tableDir, TableDirectory::get_size (), numTables);
}
private:
STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION (TTCHeader, 1, 2);
inline unsigned int get_face_count (void) const { return table.len; }
-
- inline const OpenTypeFontFace& get_face (unsigned int i) const
- {
- return this+table[i];
- }
+ inline const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; }
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
}
}
- /* This is how you get a table */
- inline const char* get_table_data (const OpenTypeTable& table) const
- {
- if (HB_UNLIKELY (table.offset == 0)) return NULL;
- return CharP(this) + table.offset;
- }
-
inline bool sanitize (SANITIZE_ARG_DEF) {
TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false;
case GSUBGPOS::GPOSTag:
{
- const GSUBGPOS &g = GSUBGPOS::get_for_data (ot.get_table_data (table));
+ const GSUBGPOS &g = GSUBGPOS::get_for_data ((const char *) &ot + table.offset);
int num_scripts = g.get_script_count ();
printf (" %d script(s) found in table\n", num_scripts);
case GDEF::Tag:
{
- const GDEF &gdef = GDEF::get_for_data (ot.get_table_data (table));
+ const GDEF &gdef = GDEF::get_for_data ((const char *) &ot + table.offset);
printf (" Has %sglyph classes\n",
gdef.has_glyph_classes () ? "" : "no ");