mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
tests: Fix potential out-of-bound access violation in svolume cpu-test
nsamples should be forced to be a multiple of channels; do so correctly and don't make nsamples larger than it actually is Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
parent
3a942fc191
commit
2dc51f3371
1 changed files with 2 additions and 2 deletions
|
|
@ -84,8 +84,8 @@ static void run_volume_test(pa_do_volume_func_t func, pa_do_volume_func_t orig_f
|
|||
samples_orig = s_orig + (8 - align);
|
||||
nsamples = SAMPLES - (8 - align);
|
||||
if (nsamples % channels)
|
||||
nsamples += nsamples % channels;
|
||||
size = nsamples * sizeof(*samples);
|
||||
nsamples -= nsamples % channels;
|
||||
size = nsamples * sizeof(int16_t);
|
||||
|
||||
pa_random(samples, size);
|
||||
memcpy(samples_ref, samples, size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue