Index: src/core/SkAdvancedTypefaceMetrics.cpp |
diff --git a/src/core/SkAdvancedTypefaceMetrics.cpp b/src/core/SkAdvancedTypefaceMetrics.cpp |
index ce64a42d0a9bfb2cbce7d7d405c3db4d217b2254..f9b25dc96aac1808cf59e6dbea403fa3d8e2024c 100644 |
--- a/src/core/SkAdvancedTypefaceMetrics.cpp |
+++ b/src/core/SkAdvancedTypefaceMetrics.cpp |
@@ -169,6 +169,8 @@ SkAdvancedTypefaceMetrics::AdvanceMetric<Data>* getAdvanceData( |
Data advance = kInvalidAdvance; |
if (gId < lastIndex) { |
// Get glyph id only when subset is NULL, or the id is in subset. |
+ SkASSERT(!subsetGlyphIDs || (subsetIndex < subsetGlyphIDsLength && |
+ static_cast<uint32_t>(gId) <= subsetGlyphIDs[subsetIndex])); |
if (!subsetGlyphIDs || |
(subsetIndex < subsetGlyphIDsLength && |
static_cast<uint32_t>(gId) == subsetGlyphIDs[subsetIndex])) { |