Skip to content

Commit

Permalink
Fix testrawconverter vector out-of-bounds access (see #72).
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Westerfeld <[email protected]>
  • Loading branch information
swesterfeld committed Dec 29, 2024
1 parent 2b29f3f commit c9199ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/testrawconverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ main (int argc, char **argv)
uint64_t K = 33452759; // prime
vector<float> in_samples (K), out_samples (K);
vector<unsigned char> bytes (K * 4);
for (uint64_t k = 0; k <= K; k++)
in_samples[k] = (-1 + double (2 * k) / K);
for (uint64_t k = 0; k < K; k++)
in_samples[k] = (-1 + double (2 * k) / (K - 1));

test_int16 ("int16", in_samples, Encoding::SIGNED);
test_int16 ("uint16", in_samples, Encoding::UNSIGNED);
Expand Down

0 comments on commit c9199ae

Please sign in to comment.