[pulseaudio-commits] src/modules
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Wed May 30 17:07:28 UTC 2018
src/modules/alsa/module-alsa-card.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 9e5be0899f60208046f1c5e2d32a2dd207d8fa00
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Thu May 24 20:31:51 2018 +0300
alsa-card: fix null dereference
jack->melem can be null if the jack disappears between probing the card
and the init_jacks() call. I don't know if jacks actually ever disappear
like that (seems unlikely), but this check is in any case needed as long
as init_jacks() has proper handling for the jack disappearing case
(rather than just an assert).
There was a crash report[1] that indicated that card_suspend_changed()
called report_jack_state() with a null melem. I don't know if that was
because the jack actually disappeared, or is there some other bug too.
[1] https://bugs.freedesktop.org/show_bug.cgi?id=104385
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index b193d40c..1f78f18d 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -640,7 +640,8 @@ static pa_hook_result_t card_suspend_changed(pa_core *c, pa_card *card, struct u
if (card->suspend_cause == 0) {
/* We were unsuspended, update jack state in case it changed while we were suspended */
PA_HASHMAP_FOREACH(jack, u->jacks, state) {
- report_jack_state(jack->melem, 0);
+ if (jack->melem)
+ report_jack_state(jack->melem, 0);
}
}
More information about the pulseaudio-commits
mailing list