mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-26 12:27:51 +02:00
fix memcpy erroneously used on overlapping buffer regions as described in #1379
This commit is contained in:
@ -41,10 +41,10 @@ namespace dsp::filter {
|
||||
|
||||
// Move existing data to make transition seemless
|
||||
if (_taps.size < oldTC) {
|
||||
memcpy(buffer, &buffer[oldTC - _taps.size], (_taps.size - 1) * sizeof(D));
|
||||
memmove(buffer, &buffer[oldTC - _taps.size], (_taps.size - 1) * sizeof(D));
|
||||
}
|
||||
else if (_taps.size > oldTC) {
|
||||
memcpy(&buffer[_taps.size - oldTC], buffer, (oldTC - 1) * sizeof(D));
|
||||
memmove(&buffer[_taps.size - oldTC], buffer, (oldTC - 1) * sizeof(D));
|
||||
buffer::clear<D>(buffer, _taps.size - oldTC);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user