1
0
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:
Robin Getz
2026-07-22 20:44:45 -04:00
parent 2d8182bef2
commit 95548a92aa
+3 -3
View File
@@ -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()