From 471d87bc16f1514fc1904e687e80e27e5ee13a96 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 18 Jun 2020 18:37:07 +0200 Subject: [PATCH] Fix dumb memory error when reading buffers Not sure how this got in, and I'm even less sure why this has not caused any issues before this. In the particular case that was causing a crash, the host was sending 138 sample sized buffers. This error likely only became visible because the lack of memory alignment caused writes to parts of the vector objects themselves. --- CHANGELOG.md | 2 ++ src/plugin/plugin-bridge.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 144f3268..e713aa07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed +- Fixed memory error that was causing playback issues with some buffer sizes in + Mixbus6. - Fixed plugin group socket name generation. This prevented plugin groups with the same name from being used simultaneously in multiple Wine prefixes. diff --git a/src/plugin/plugin-bridge.cpp b/src/plugin/plugin-bridge.cpp index 4b9350c3..652bdf67 100644 --- a/src/plugin/plugin-bridge.cpp +++ b/src/plugin/plugin-bridge.cpp @@ -512,7 +512,7 @@ void PluginBridge::process_replacing(AEffect* /*plugin*/, std::vector> input_buffers( plugin.numInputs, std::vector(sample_frames)); for (int channel = 0; channel < plugin.numInputs; channel++) { - std::copy(inputs[channel], inputs[channel] + sample_frames + 1, + std::copy(inputs[channel], inputs[channel] + sample_frames, input_buffers[channel].begin()); }