summaryrefslogtreecommitdiff
path: root/src/hb-set-digest-private.hh
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2017-12-16 06:12:06 -0800
committerBehdad Esfahbod <behdad@behdad.org>2017-12-16 06:12:06 -0800
commit81f27df4d9db1bfc1dd04593cbd121397b86e9a6 (patch)
tree75986c1e2f14e6155acb9623c1e8cec67233a7ee /src/hb-set-digest-private.hh
parent5d02572034e3dafbe87000fd0aa34b858bd95075 (diff)
More work towards improving collect_glyphs() against bad input
The three "XXXXX"'s should be switched to false. Doing that separately for ease of bisecting...
Diffstat (limited to 'src/hb-set-digest-private.hh')
-rw-r--r--src/hb-set-digest-private.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hb-set-digest-private.hh b/src/hb-set-digest-private.hh
index 0f798ab6..e099a826 100644
--- a/src/hb-set-digest-private.hh
+++ b/src/hb-set-digest-private.hh
@@ -71,7 +71,7 @@ struct hb_set_digest_lowest_bits_t
mask |= mask_for (g);
}
- inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
+ inline bool add_range (hb_codepoint_t a, hb_codepoint_t b) {
if ((b >> shift) - (a >> shift) >= mask_bits - 1)
mask = (mask_t) -1;
else {
@@ -79,6 +79,7 @@ struct hb_set_digest_lowest_bits_t
mask_t mb = mask_for (b);
mask |= mb + (mb - ma) - (mb < ma);
}
+ return true;
}
template <typename T>
@@ -128,9 +129,10 @@ struct hb_set_digest_combiner_t
tail.add (g);
}
- inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
+ inline bool add_range (hb_codepoint_t a, hb_codepoint_t b) {
head.add_range (a, b);
tail.add_range (a, b);
+ return true;
}
template <typename T>
inline void add_array (const T *array, unsigned int count, unsigned int stride=sizeof(T))