From 4c27da7638f6d072c3ff93223488c4ab316236c1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 15 Oct 2018 19:46:45 -0700 Subject: [PATCH] [CBDT] Fix more offsetting Fixes https://oss-fuzz.com/v2/testcase-detail/5750379279548416 --- src/hb-ot-color-cbdt-table.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 304596840..1e1fe0956 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -209,9 +209,10 @@ struct IndexSubtableRecord offsetToSubtable.sanitize (c, base, lastGlyphIndex - firstGlyphIndex + 1)); } - inline bool get_extents (hb_glyph_extents_t *extents) const + inline bool get_extents (hb_glyph_extents_t *extents, + const void *base) const { - return (this+offsetToSubtable).get_extents (extents); + return (base+offsetToSubtable).get_extents (extents); } bool get_image_data (unsigned int gid, @@ -420,7 +421,7 @@ struct CBDT if (!subtable_record || !x_ppem || !y_ppem) return false; - if (subtable_record->get_extents (extents)) + if (subtable_record->get_extents (extents, base)) return true; unsigned int image_offset = 0, image_length = 0, image_format = 0;