aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2019-03-08 10:32:19 +0100
committerArun Raghavan <arun@arunraghavan.net>2019-03-29 06:04:28 +0000
commitac4a50268f205d77eb6b94294915acef9b1d5d6f (patch)
tree7392abf132a67dd60f5d97105866502fe195cb0d
parent993d3fd89e5611997f1e165bf03edefb0204b0a4 (diff)
downloadpulseaudio-ac4a50268f205d77eb6b94294915acef9b1d5d6f.tar.gz
tests: fix possible segfault in cpu-remap-test
pa_init_remap_func() takes care to initialise pa_remap_t.do_remap to NULL before calling init_remap_func (the CPU-specific remap init function) and invokes init_remap_c if init_remap_func did not set pa_remap_t.do_remap to non-NULL. remap_init_test_channels() calls init_remap_func() directly so it must make sure pa_remap_t.do_remap is set to NULL. Otherwise we'll end up with a random value in pa_remap_t.do_remap if there is no CPU-optimised remap function for the current operation.
-rw-r--r--src/tests/cpu-remap-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tests/cpu-remap-test.c b/src/tests/cpu-remap-test.c
index c4eec459..b4b70b89 100644
--- a/src/tests/cpu-remap-test.c
+++ b/src/tests/cpu-remap-test.c
@@ -212,7 +212,7 @@ static void remap_init_test_channels(
unsigned out_channels,
bool rearrange) {
- pa_remap_t remap_orig, remap_func;
+ pa_remap_t remap_orig = {0}, remap_func = {0};
setup_remap_channels(&remap_orig, f, in_channels, out_channels, rearrange);
orig_init_func(&remap_orig);