Merge pull request #5139 from harfbuzz/set-malloc-fix

[set] Fix reallocation
This commit is contained in:
Behdad Esfahbod 2025-03-13 13:41:43 -06:00 committed by GitHub
commit 471ac1cdc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View file

@ -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) ||

View file

@ -442,7 +442,6 @@ struct hb_vector_t
new_allocated += (new_allocated >> 1) + 8;
}
/* Reallocate */
bool overflows =