diff options
author | Kai Blaschke <kai.blaschke@gdata.de> | 2024-02-18 13:36:37 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 14:13:33 +0100 |
commit | c731eedeaf1c24e5c4444467c29510e091349ff1 (patch) | |
tree | ba63fdb20dc19e1077e01581744be73e1c085c21 /source/frontend/StarVoice.cpp | |
parent | 30e1871d3f44629e00a1f66d8164e3e62c7f889f (diff) |
Use memmove instead of memcpy as the blocks overlap.
Diffstat (limited to 'source/frontend/StarVoice.cpp')
-rw-r--r-- | source/frontend/StarVoice.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp index 168d23b..68b83ae 100644 --- a/source/frontend/StarVoice.cpp +++ b/source/frontend/StarVoice.cpp @@ -433,7 +433,7 @@ void Voice::update(float dt, PositionalAttenuationFunction positionalAttenuation speaker->channelVolumes = Vec2F::filled(1.0f); auto& dbHistory = speaker->dbHistory; - memcpy(&dbHistory[1], &dbHistory[0], (dbHistory.size() - 1) * sizeof(float)); + memmove(&dbHistory[1], &dbHistory[0], (dbHistory.size() - 1) * sizeof(float)); dbHistory[0] = speaker->decibelLevel; float smoothDb = 0.0f; for (float dB : dbHistory) |