tests: fix possible segfault in cpu-remap-test
authorSascha Silbe <sascha-pgp@silbe.org>
Fri, 8 Mar 2019 09:32:19 +0000 (10:32 +0100)
committerArun Raghavan <arun@arunraghavan.net>
Fri, 29 Mar 2019 06:04:28 +0000 (06:04 +0000)
commitac4a50268f205d77eb6b94294915acef9b1d5d6f
tree7392abf132a67dd60f5d97105866502fe195cb0d
parent993d3fd89e5611997f1e165bf03edefb0204b0a4
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.
src/tests/cpu-remap-test.c