common array: -- sanitizer errors

runtime error: null pointer passed as argument 1, which is declared to never be null

@Issue: https://github.com/Samsung/thorvg/issues/543
This commit is contained in:
Hermet Park 2021-07-01 17:38:34 +09:00 committed by Hermet Park
parent e1eabf7dc3
commit 480bd8376e

View file

@ -75,7 +75,7 @@ struct Array
void operator=(const Array& rhs)
{
reserve(rhs.count);
memcpy(data, rhs.data, sizeof(T) * reserved);
if (rhs.count > 0) memcpy(data, rhs.data, sizeof(T) * reserved);
count = rhs.count;
}