diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-12-16 06:12:06 -0800 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2017-12-16 06:12:06 -0800 |
commit | 81f27df4d9db1bfc1dd04593cbd121397b86e9a6 (patch) | |
tree | 75986c1e2f14e6155acb9623c1e8cec67233a7ee /src/hb-set-digest-private.hh | |
parent | 5d02572034e3dafbe87000fd0aa34b858bd95075 (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.hh | 6 |
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)) |