Add check for size of head table to woff2 enc

This commit is contained in:
Rod Sheeter
2017-02-15 13:52:56 -08:00
parent b91b020ced
commit 82a9f3afb2
+6
View File
@@ -105,6 +105,12 @@ bool ReadTrueTypeFont(Buffer* file, const uint8_t* data, size_t len,
last_offset = i.first + i.second;
}
// Sanity check key tables
const Font::Table* head_table = font->FindTable(kHeadTableTag);
if (head_table != NULL && head_table->length < 52) {
return FONT_COMPRESSION_FAILURE();
}
return true;
}