mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
[set] in hb_set_set() avoid calling memcpy on nullptr.
This commit is contained in:
1 parent
2b9cb29923
commit
c581d11eba
1 file changed
+5
@@ -488,6 +488,11 @@ struct hb_set_t
|
||||
if (!resize (count))
|
||||
return;
|
||||
population = other.population;
|
||||
|
||||
if (!count)
|
||||
// memcpy is not necessary if the vectors are zero length. This avoids possibly
|
||||
// passing nullptr to memcpy.
|
||||
return;
|
||||
memcpy ((void *) pages, (const void *) other.pages, count * pages.item_size);
|
||||
memcpy ((void *) page_map, (const void *) other.page_map, count * page_map.item_size);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user