diff --git a/modules/juce_core/containers/juce_ArrayBase.h b/modules/juce_core/containers/juce_ArrayBase.h index af39b2ed7d..711bb6122c 100644 --- a/modules/juce_core/containers/juce_ArrayBase.h +++ b/modules/juce_core/containers/juce_ArrayBase.h @@ -402,7 +402,8 @@ private: template TriviallyCopyableVoid addArrayInternal (const ElementType* otherElements, int numElements) { - memcpy (elements + numUsed, otherElements, (size_t) numElements * sizeof (ElementType)); + if (numElements > 0) + memcpy (elements + numUsed, otherElements, (size_t) numElements * sizeof (ElementType)); } template