mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
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
This commit is contained in:
parent
1e68e9aa10
commit
9e5be0899f
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue