mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-27 12:34:18 -04:00
WDSP: Fix invalid iterator ranges in SPHP flush
Correct std::fill() calls in SPHP::flush() that used x0.end() as the end iterator when clearing x1, y0, and y1. The incorrect ranges were likely introduced by a copy/paste error and resulted in iterator pairs from different containers being used together, causing undefined behavior. Use each buffer's own end iterator when clearing its contents. Detected by cppcheck's mismatchingContainer check. Signed-off-by: Robin Getz <rgetz503@gmail.com>
This commit is contained in:
+3
-3
@@ -72,9 +72,9 @@ SPHP::SPHP(
|
||||
void SPHP::flush()
|
||||
{
|
||||
std::fill(x0.begin(), x0.end(), 0);
|
||||
std::fill(x1.begin(), x0.end(), 0);
|
||||
std::fill(y0.begin(), x0.end(), 0);
|
||||
std::fill(y1.begin(), x0.end(), 0);
|
||||
std::fill(x1.begin(), x1.end(), 0);
|
||||
std::fill(y0.begin(), y0.end(), 0);
|
||||
std::fill(y1.begin(), y1.end(), 0);
|
||||
}
|
||||
|
||||
void SPHP::execute()
|
||||
|
||||
Reference in New Issue
Block a user