]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: Fix segfault with 32bit libs
authorTakashi Iwai <tiwai@suse.de>
Sat, 9 Sep 2023 15:42:03 +0000 (17:42 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sat, 9 Sep 2023 15:42:03 +0000 (17:42 +0200)
commit0e3dfb9f705ca78be34cd70fd59d67c431e29cc7
treef62a7f5bb7ea897ae8b3484547673eda495382c8
parent10bd599970acc71c92f85eb08943eb8d3d702a9c
pcm: Fix segfault with 32bit libs

The recent rearrangement of header inclusion order caused a regression
showing segfaults on 32bit Arm.  The primary reason is the
inconsistent compile condition depending on the inclusion of config.h;
while most of other code include pcm_local.h (that implicitly includes
config.h) at first, pcm_direct.c doesn't do it, hence the access with
direct plugins crashes.

For fixing it, we need to include config.h at the beginning.  But,
it's better to include pcm_local.h for all relevant code for
consistency.  The patch does it, and also it adds the guard in
pcm_local.h for double inclusions.

Fixes: ad3a8b8b314e ("reshuffle included files to include config.h as first")
Link: https://github.com/alsa-project/alsa-lib/issues/352
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_direct.c
src/pcm/pcm_dmix.c
src/pcm/pcm_dshare.c
src/pcm/pcm_dsnoop.c
src/pcm/pcm_local.h
src/pcm/pcm_shm.c