diff options
Diffstat (limited to 'cpp/src/sfntly/table/truetype/glyph_table.cc')
-rw-r--r-- | cpp/src/sfntly/table/truetype/glyph_table.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cpp/src/sfntly/table/truetype/glyph_table.cc b/cpp/src/sfntly/table/truetype/glyph_table.cc index f38fac5..0c1e841 100644 --- a/cpp/src/sfntly/table/truetype/glyph_table.cc +++ b/cpp/src/sfntly/table/truetype/glyph_table.cc @@ -215,10 +215,11 @@ CALLER_ATTACH GlyphTable::Glyph* ReadableFontDataPtr sliced_data; sliced_data.Attach(down_cast<ReadableFontData*>(data->Slice(offset, length))); - if (type == GlyphType::kSimple) { - glyph = new SimpleGlyph(sliced_data); - } else { - glyph = new CompositeGlyph(sliced_data); + if (sliced_data) { + if (type == GlyphType::kSimple) + glyph = new SimpleGlyph(sliced_data); + else + glyph = new CompositeGlyph(sliced_data); } return glyph.Detach(); } |