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

Unified Diff: third_party/harfbuzz-ng/src/hb-ot-map.cc

Issue 2318273003: Roll HarfBuzz to 1.3.1 (Closed)
Patch Set: Created 4 years, 3 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/harfbuzz-ng/src/hb-ft.cc ('k') | third_party/harfbuzz-ng/src/hb-ot-tag.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz-ng/src/hb-ot-map.cc
diff --git a/third_party/harfbuzz-ng/src/hb-ot-map.cc b/third_party/harfbuzz-ng/src/hb-ot-map.cc
index 7822cef8b3c3f56dec9a0e8efd8d3a800b94f935..17e3f4065e3c6347207e7d0a565dad50c2bede61 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-map.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-map.cc
@@ -193,7 +193,8 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
/* Uses the global bit */
bits_needed = 0;
else
- bits_needed = _hb_bit_storage (info->max_value);
+ /* Limit to 8 bits per feature. */
+ bits_needed = MIN(8u, _hb_bit_storage (info->max_value));
if (!info->max_value || next_bit + bits_needed > 8 * sizeof (hb_mask_t))
continue; /* Feature disabled, or not enough bits. */
@@ -243,11 +244,11 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
map->mask = 1;
} else {
map->shift = next_bit;
- map->mask = (1 << (next_bit + bits_needed)) - (1 << next_bit);
+ map->mask = (1u << (next_bit + bits_needed)) - (1u << next_bit);
next_bit += bits_needed;
m.global_mask |= (info->default_value << map->shift) & map->mask;
}
- map->_1_mask = (1 << map->shift) & map->mask;
+ map->_1_mask = (1u << map->shift) & map->mask;
map->needs_fallback = !found;
}
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ft.cc ('k') | third_party/harfbuzz-ng/src/hb-ot-tag.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698