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

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

Issue 2210893002: Roll OTS to 8d70cffebbfa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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/README.chromium ('k') | third_party/ots/src/math.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ots/src/cmap.cc
diff --git a/third_party/ots/src/cmap.cc b/third_party/ots/src/cmap.cc
index cbb5f3c332375f3be3c99e8de286d88d7d386d76..325f8e0d182299fabadc8ab678d21e13a12adc0d 100644
--- a/third_party/ots/src/cmap.cc
+++ b/third_party/ots/src/cmap.cc
@@ -658,20 +658,21 @@ bool ots_cmap_parse(Font *font, const uint8_t *data, size_t length) {
}
// check if the table is sorted first by platform ID, then by encoding ID.
- uint32_t last_id = 0;
- for (unsigned i = 0; i < num_tables; ++i) {
- uint32_t current_id
- = (subtable_headers[i].platform << 24)
- + (subtable_headers[i].encoding << 16)
- + subtable_headers[i].language;
- if ((i != 0) && (last_id >= current_id)) {
+ for (unsigned i = 1; i < num_tables; ++i) {
+ if (subtable_headers[i - 1].platform > subtable_headers[i].platform ||
+ (subtable_headers[i - 1].platform == subtable_headers[i].platform &&
+ (subtable_headers[i - 1].encoding > subtable_headers[i].encoding ||
+ (subtable_headers[i - 1].encoding == subtable_headers[i].encoding &&
+ subtable_headers[i - 1].language > subtable_headers[i].language))))
OTS_WARNING("subtable %d with platform ID %d, encoding ID %d, language ID %d "
"following subtable with platform ID %d, encoding ID %d, language ID %d",
i,
- (uint8_t)(current_id >> 24), (uint8_t)(current_id >> 16), (uint8_t)(current_id),
- (uint8_t)(last_id >> 24), (uint8_t)(last_id >> 16), (uint8_t)(last_id));
- }
- last_id = current_id;
+ subtable_headers[i].platform,
+ subtable_headers[i].encoding,
+ subtable_headers[i].language,
+ subtable_headers[i - 1].platform,
+ subtable_headers[i - 1].encoding,
+ subtable_headers[i - 1].language);
}
// Now, verify that all the lengths are sane
« no previous file with comments | « third_party/ots/README.chromium ('k') | third_party/ots/src/math.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698