Skip to content

Commit

Permalink
[set] Handle nil set in add_range() / add_sorted_array()
Browse files Browse the repository at this point in the history
Fixes #657
  • Loading branch information
behdad committed Dec 19, 2017
1 parent b5bbb79 commit 2fe5f88
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hb-set-private.hh
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ struct hb_set_t
}
inline bool add_range (hb_codepoint_t a, hb_codepoint_t b)
{
if (unlikely (in_error || a > b || a == INVALID || b == INVALID)) return false;
if (unlikely (in_error)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */
if (unlikely (a > b || a == INVALID || b == INVALID)) return false;
unsigned int ma = get_major (a);
unsigned int mb = get_major (b);
if (ma == mb)
Expand Down Expand Up @@ -283,7 +284,7 @@ struct hb_set_t
template <typename T>
inline bool add_sorted_array (const T *array, unsigned int count, unsigned int stride=sizeof(T))
{
if (unlikely (in_error)) return false;
if (unlikely (in_error)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */
if (!count) return true;
hb_codepoint_t g = *array;
hb_codepoint_t last_g = g;
Expand Down

0 comments on commit 2fe5f88

Please sign in to comment.