aboutsummaryrefslogtreecommitdiff
path: root/cpp/src/sfntly/table/core/font_header_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/sfntly/table/core/font_header_table.cc')
-rw-r--r--cpp/src/sfntly/table/core/font_header_table.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/sfntly/table/core/font_header_table.cc b/cpp/src/sfntly/table/core/font_header_table.cc
index 60015ca..a848afd 100644
--- a/cpp/src/sfntly/table/core/font_header_table.cc
+++ b/cpp/src/sfntly/table/core/font_header_table.cc
@@ -239,7 +239,10 @@ void FontHeaderTable::Builder::SetFontDirectionHint(int32_t hint) {
}
int32_t FontHeaderTable::Builder::IndexToLocFormat() {
- return down_cast<FontHeaderTable*>(GetTable())->IndexToLocFormat();
+ Table* table = GetTable();
+ if (!table)
+ return IndexToLocFormat::kInvalidOffset;
+ return down_cast<FontHeaderTable*>(table)->IndexToLocFormat();
}
void FontHeaderTable::Builder::SetIndexToLocFormat(int32_t format) {