Skip to content

Commit a8d81a3

Browse files
committed
Add assertions
1 parent be22663 commit a8d81a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Robocode/SRC.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ void SRC::resample(const std::span<const float> input, const std::span<float> ou
6666
src_strerror(error));
6767
}
6868

69+
assert_true(src.data.input_frames_used == src.data.input_frames, "Not all src frames are used!");
70+
6971
auto n = static_cast<size_t>(std::max(src.data.output_frames_gen, 0L));
7072

7173
callback({src.buffer.data(), n}, {dst.buffer.data(), n});
@@ -84,6 +86,8 @@ void SRC::resample(const std::span<const float> input, const std::span<float> ou
8486
src_strerror(error));
8587
}
8688

89+
assert_true(dst.data.input_frames_used == dst.data.input_frames, "Not all dst frames are used!");
90+
8791
auto m = static_cast<size_t>(std::max(dst.data.output_frames_gen, 0L));
8892

8993
std::fill(output.begin() + m, output.end(), float(0));

0 commit comments

Comments
 (0)