[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] tests: fix use of uninitialized variable cpu_info

PulseAudio Marge Bot gitlab at gitlab.freedesktop.org
Mon Mar 1 15:10:15 UTC 2021



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
2afecd63 by Faidon Liambotis at 2021-03-01T15:02:11+00:00
tests: fix use of uninitialized variable cpu_info

On cpu-volume-test, cpu_info is initialized only on i386/amd64 systems,
and otherwise passed on to pa_cpu_init_orc() uninitialized.

If one was unlucky enough, they could end up with cpu_info.cpu_type ==
PA_CPU_X86 on a non-x86 system, and use and test the Orc codepath
without that being functional, and thus with the test failing.

This has been observed in the wild on the ppc64el Debian buildds. See
Debian bug #982740 for more context.

Define cpu_info here in the same way as in other tests.

Signed-off-by: Faidon Liambotis <paravoid at debian.org>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/511>

- - - - -


1 changed file:

- src/tests/cpu-volume-test.c


Changes:

=====================================
src/tests/cpu-volume-test.c
=====================================
@@ -187,7 +187,7 @@ END_TEST
 
 START_TEST (svolume_orc_test) {
     pa_do_volume_func_t orig_func, orc_func;
-    pa_cpu_info cpu_info;
+    pa_cpu_info cpu_info = { PA_CPU_UNDEFINED, {}, false };
     int i, j;
 
 #if defined (__i386__) || defined (__amd64__)



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/2afecd637c8ebd461df945a509b11e03f4e954a5

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/2afecd637c8ebd461df945a509b11e03f4e954a5
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210301/4ad2a783/attachment-0001.htm>


More information about the pulseaudio-commits mailing list