Index: third_party/ots/src/cff_type2_charstring.cc |
diff --git a/third_party/ots/src/cff_type2_charstring.cc b/third_party/ots/src/cff_type2_charstring.cc |
index a164ec16380948b441640d72801d245225f40280..8c5544b2ec4b99c52c0167573ea4f2a5cb04aa7b 100644 |
--- a/third_party/ots/src/cff_type2_charstring.cc |
+++ b/third_party/ots/src/cff_type2_charstring.cc |
@@ -852,14 +852,12 @@ bool ValidateType2CharStringIndex( |
const std::vector<CFFIndex *> &local_subrs_per_font, |
const CFFIndex *local_subrs, |
Buffer* cff_table) { |
- const uint16_t num_offsets = |
- static_cast<uint16_t>(char_strings_index.offsets.size()); |
- if (num_offsets != char_strings_index.offsets.size() || num_offsets == 0) { |
+ if (char_strings_index.offsets.size() == 0) { |
return OTS_FAILURE(); // no charstring. |
} |
// For each glyph, validate the corresponding charstring. |
- for (uint16_t i = 1; i < num_offsets; ++i) { |
+ for (unsigned i = 1; i < char_strings_index.offsets.size(); ++i) { |
// Prepare a Buffer object, |char_string|, which contains the charstring |
// for the |i|-th glyph. |
const size_t length = |
@@ -875,7 +873,7 @@ bool ValidateType2CharStringIndex( |
Buffer char_string(cff_table->buffer() + offset, length); |
// Get a local subrs for the glyph. |
- const uint16_t glyph_index = i - 1; // index in the map is 0-origin. |
+ const unsigned glyph_index = i - 1; // index in the map is 0-origin. |
const CFFIndex *local_subrs_to_use = NULL; |
if (!SelectLocalSubr(fd_select, |
local_subrs_per_font, |