aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Chromium Automerger <chromium-automerger@android>2014-05-01 01:09:55 +0000
committerAndroid Chromium Automerger <chromium-automerger@android>2014-05-01 01:09:55 +0000
commit4102fb9b0ae454d09160d2d206e3fdcbcff958db (patch)
treebd6fd06ba7ace276ba0b6d60771c9ff29bee86ad
parentb4a860077f85cbc2fcfceee90ec60cc152550199 (diff)
parent52c48f7ae423c497de8f2268f7c41490b9882a6f (diff)
downloadots-4102fb9b0ae454d09160d2d206e3fdcbcff958db.tar.gz
Merge third_party/ots from https://chromium.googlesource.com/external/ots.git at 52c48f7ae423c497de8f2268f7c41490b9882a6f
This commit was generated by merge_from_chromium.py. Change-Id: Ie98f2feb8e40737b108d2e05749f2012030f6e3c
-rw-r--r--src/woff2.cc49
1 files changed, 41 insertions, 8 deletions
diff --git a/src/woff2.cc b/src/woff2.cc
index 34d8b42..97aeba9 100644
--- a/src/woff2.cc
+++ b/src/woff2.cc
@@ -85,6 +85,40 @@ const uint32_t kKnownTags[] = {
TAG('G', 'D', 'E', 'F'), // 26
TAG('G', 'P', 'O', 'S'), // 27
TAG('G', 'S', 'U', 'B'), // 28
+ TAG('E', 'B', 'S', 'C'), // 29
+ TAG('J', 'S', 'T', 'F'), // 30
+ TAG('M', 'A', 'T', 'H'), // 31
+ TAG('C', 'B', 'D', 'T'), // 32
+ TAG('C', 'B', 'L', 'C'), // 33
+ TAG('C', 'O', 'L', 'R'), // 34
+ TAG('C', 'P', 'A', 'L'), // 35
+ TAG('S', 'V', 'G', ' '), // 36
+ TAG('s', 'b', 'i', 'x'), // 37
+ TAG('a', 'c', 'n', 't'), // 38
+ TAG('a', 'v', 'a', 'r'), // 39
+ TAG('b', 'd', 'a', 't'), // 40
+ TAG('b', 'l', 'o', 'c'), // 41
+ TAG('b', 's', 'l', 'n'), // 42
+ TAG('c', 'v', 'a', 'r'), // 43
+ TAG('f', 'd', 's', 'c'), // 44
+ TAG('f', 'e', 'a', 't'), // 45
+ TAG('f', 'm', 't', 'x'), // 46
+ TAG('f', 'v', 'a', 'r'), // 47
+ TAG('g', 'v', 'a', 'r'), // 48
+ TAG('h', 's', 't', 'y'), // 49
+ TAG('j', 'u', 's', 't'), // 50
+ TAG('l', 'c', 'a', 'r'), // 51
+ TAG('m', 'o', 'r', 't'), // 52
+ TAG('m', 'o', 'r', 'x'), // 53
+ TAG('o', 'p', 'b', 'd'), // 54
+ TAG('p', 'r', 'o', 'p'), // 55
+ TAG('t', 'r', 'a', 'k'), // 56
+ TAG('Z', 'a', 'p', 'f'), // 57
+ TAG('S', 'i', 'l', 'f'), // 58
+ TAG('G', 'l', 'a', 't'), // 59
+ TAG('G', 'l', 'o', 'c'), // 60
+ TAG('F', 'e', 'a', 't'), // 61
+ TAG('S', 'i', 'l', 'l'), // 62
};
struct Point {
@@ -772,25 +806,24 @@ bool ReadShortDirectory(ots::Buffer* file, std::vector<Table>* tables,
return OTS_FAILURE();
}
uint32_t tag;
- if ((flag_byte & 0x1f) == 0x1f) {
+ if ((flag_byte & 0x3f) == 0x3f) {
if (!file->ReadU32(&tag)) {
return OTS_FAILURE();
}
} else {
- if ((flag_byte & 0x1f) >= arraysize(kKnownTags)) {
- return OTS_FAILURE();
- }
- tag = kKnownTags[flag_byte & 0x1f];
+ tag = kKnownTags[flag_byte & 0x3f];
}
- // Bits 5 and 6 are reserved and must be 0.
- if ((flag_byte & 0x60) != 0) {
+ // Bits 6 and 7 are reserved and must be 0.
+ if ((flag_byte & 0xc0) != 0) {
return OTS_FAILURE();
}
uint32_t flags = kCompressionTypeBrotli;
if (i > 0) {
flags |= kWoff2FlagsContinueStream;
}
- if ((flag_byte & 0x80) != 0) {
+ // Always transform the glyf and loca tables
+ if (tag == TAG('g', 'l', 'y', 'f') ||
+ tag == TAG('l', 'o', 'c', 'a')) {
flags |= kWoff2FlagsTransform;
}
uint32_t dst_length;