From 86d82060ad1064cbe8becc3b76a50796f0d7a40c Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sun, 11 Apr 2021 19:39:27 +0200 Subject: [PATCH] Fix note events copy --- plugins/vst/SfizzVstUpdates.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/vst/SfizzVstUpdates.cpp b/plugins/vst/SfizzVstUpdates.cpp index d9921bdb..20e7c1e4 100644 --- a/plugins/vst/SfizzVstUpdates.cpp +++ b/plugins/vst/SfizzVstUpdates.cpp @@ -5,6 +5,7 @@ // If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz #include "SfizzVstUpdates.h" +#include #include OSCUpdate::~OSCUpdate() @@ -57,7 +58,7 @@ void NoteUpdate::setEvents(const std::pair* events, uint32_t co if (copy) { auto *buffer = new std::pair[count]; - std::memcpy(buffer, events, count); + std::copy_n(events, count, buffer); events = buffer; }