Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: third_party/ots/src/gpos.cc

Issue 1487543005: Update OTS to revision 99a3b7f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ots/src/gdef.cc ('k') | third_party/ots/src/gsub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/gpos.cc
diff --git a/third_party/ots/src/gpos.cc b/third_party/ots/src/gpos.cc
index 2625ec8966a7b3c2c92db475f1c75991c3a6341b..83d9ab0536a44960cb9d72917759b98d62f2a91f 100644
--- a/third_party/ots/src/gpos.cc
+++ b/third_party/ots/src/gpos.cc
@@ -675,13 +675,6 @@ bool ParseExtensionPositioning(const ots::Font *font,
} // namespace
-#define DROP_THIS_TABLE(msg_) \
- do { \
- OTS_FAILURE_MSG(msg_ ", table discarded"); \
- font->gpos->data = 0; \
- font->gpos->length = 0; \
- } while (0)
-
namespace ots {
// As far as I checked, following fonts contain invalid GPOS table and
@@ -749,55 +742,47 @@ bool ots_gpos_parse(Font *font, const uint8_t *data, size_t length) {
!table.ReadU16(&offset_script_list) ||
!table.ReadU16(&offset_feature_list) ||
!table.ReadU16(&offset_lookup_list)) {
- DROP_THIS_TABLE("Incomplete table");
- return true;
+ return OTS_FAILURE_MSG("Incomplete table");
}
if (version != 0x00010000) {
- DROP_THIS_TABLE("Bad version");
- return true;
+ return OTS_FAILURE_MSG("Bad version");
}
if (offset_lookup_list) {
if (offset_lookup_list < kGposHeaderSize || offset_lookup_list >= length) {
- DROP_THIS_TABLE("Bad lookup list offset in table header");
- return true;
+ return OTS_FAILURE_MSG("Bad lookup list offset in table header");
}
if (!ParseLookupListTable(font, data + offset_lookup_list,
length - offset_lookup_list,
&kGposLookupSubtableParser,
&gpos->num_lookups)) {
- DROP_THIS_TABLE("Failed to parse lookup list table");
- return true;
+ return OTS_FAILURE_MSG("Failed to parse lookup list table");
}
}
uint16_t num_features = 0;
if (offset_feature_list) {
if (offset_feature_list < kGposHeaderSize || offset_feature_list >= length) {
- DROP_THIS_TABLE("Bad feature list offset in table header");
- return true;
+ return OTS_FAILURE_MSG("Bad feature list offset in table header");
}
if (!ParseFeatureListTable(font, data + offset_feature_list,
length - offset_feature_list, gpos->num_lookups,
&num_features)) {
- DROP_THIS_TABLE("Failed to parse feature list table");
- return true;
+ return OTS_FAILURE_MSG("Failed to parse feature list table");
}
}
if (offset_script_list) {
if (offset_script_list < kGposHeaderSize || offset_script_list >= length) {
- DROP_THIS_TABLE("Bad script list offset in table header");
- return true;
+ return OTS_FAILURE_MSG("Bad script list offset in table header");
}
if (!ParseScriptListTable(font, data + offset_script_list,
length - offset_script_list, num_features)) {
- DROP_THIS_TABLE("Failed to parse script list table");
- return true;
+ return OTS_FAILURE_MSG("Failed to parse script list table");
}
}
@@ -830,4 +815,3 @@ void ots_gpos_free(Font *font) {
} // namespace ots
#undef TABLE_NAME
-#undef DROP_THIS_TABLE
« no previous file with comments | « third_party/ots/src/gdef.cc ('k') | third_party/ots/src/gsub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698