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

Unified Diff: third_party/woff2/src/glyph.cc

Issue 2736873002: Update woff2 to cbea7b9 (Closed)
Patch Set: Created 3 years, 9 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/woff2/src/font.cc ('k') | third_party/woff2/src/variable_length.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/woff2/src/glyph.cc
diff --git a/third_party/woff2/src/glyph.cc b/third_party/woff2/src/glyph.cc
index 1dadafcb700151430bf5221f420d056572295dd7..4c6b60a144701f6a0423ce14d292db0ef7cf82d0 100644
--- a/third_party/woff2/src/glyph.cc
+++ b/third_party/woff2/src/glyph.cc
@@ -118,25 +118,27 @@ bool ReadGlyph(const uint8_t* data, size_t len, Glyph* glyph) {
// Read the run-length coded flags.
std::vector<std::vector<uint8_t> > flags(num_contours);
- uint8_t flag = 0;
- uint8_t flag_repeat = 0;
- for (int i = 0; i < num_contours; ++i) {
- flags[i].resize(glyph->contours[i].size());
- for (size_t j = 0; j < glyph->contours[i].size(); ++j) {
- if (flag_repeat == 0) {
- if (!buffer.ReadU8(&flag)) {
- return FONT_COMPRESSION_FAILURE();
- }
- if (flag & kFLAG_REPEAT) {
- if (!buffer.ReadU8(&flag_repeat)) {
+ {
+ uint8_t flag = 0;
+ uint8_t flag_repeat = 0;
+ for (int i = 0; i < num_contours; ++i) {
+ flags[i].resize(glyph->contours[i].size());
+ for (size_t j = 0; j < glyph->contours[i].size(); ++j) {
+ if (flag_repeat == 0) {
+ if (!buffer.ReadU8(&flag)) {
return FONT_COMPRESSION_FAILURE();
}
+ if (flag & kFLAG_REPEAT) {
+ if (!buffer.ReadU8(&flag_repeat)) {
+ return FONT_COMPRESSION_FAILURE();
+ }
+ }
+ } else {
+ flag_repeat--;
}
- } else {
- flag_repeat--;
+ flags[i][j] = flag;
+ glyph->contours[i][j].on_curve = flag & kFLAG_ONCURVE;
}
- flags[i][j] = flag;
- glyph->contours[i][j].on_curve = flag & kFLAG_ONCURVE;
}
}
« no previous file with comments | « third_party/woff2/src/font.cc ('k') | third_party/woff2/src/variable_length.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698