mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 00:32:59 +00:00
Merge pull request #5139 from harfbuzz/set-malloc-fix
[set] Fix reallocation
This commit is contained in:
commit
471ac1cdc0
2 changed files with 1 additions and 2 deletions
|
@ -88,7 +88,7 @@ struct hb_bit_set_t
|
|||
{
|
||||
if (unlikely (!successful)) return false;
|
||||
|
||||
if (pages.length < count && count <= 2)
|
||||
if (pages.length < count && (unsigned) pages.allocated < count && count <= 2)
|
||||
exact_size = true; // Most sets are small and local
|
||||
|
||||
if (unlikely (!pages.resize (count, clear, exact_size) ||
|
||||
|
|
|
@ -442,7 +442,6 @@ struct hb_vector_t
|
|||
new_allocated += (new_allocated >> 1) + 8;
|
||||
}
|
||||
|
||||
|
||||
/* Reallocate */
|
||||
|
||||
bool overflows =
|
||||
|
|
Loading…
Add table
Reference in a new issue