mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-12 13:30:10 -05:00
dbus: Make sure that subscription callbacks don't try to access removed objects.
This commit is contained in:
parent
3e0e685a8c
commit
edf80104e3
4 changed files with 143 additions and 72 deletions
|
|
@ -465,6 +465,10 @@ static void subscription_cb(pa_core *core, pa_subscription_event_type_t t, uint3
|
|||
pa_assert((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_CARD);
|
||||
pa_assert(c);
|
||||
|
||||
/* We can't use idx != c->card->index, because the c->card pointer may
|
||||
* be stale at this point. */
|
||||
if (pa_idxset_get_by_index(core->cards, idx) != c->card)
|
||||
return;
|
||||
|
||||
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) != PA_SUBSCRIPTION_EVENT_CHANGE)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue