mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
bluez5: guard against transports without sco_io
If backend releases transport early and sco_io becomes NULL, don't access it. Also guard against calloc failing in sco_io creation.
This commit is contained in:
parent
79e098bdf2
commit
0385d0a07e
4 changed files with 21 additions and 6 deletions
|
|
@ -1575,14 +1575,17 @@ static int spa_bt_transport_stop_release_timer(struct spa_bt_transport *transpor
|
|||
return 0;
|
||||
}
|
||||
|
||||
void spa_bt_transport_ensure_sco_io(struct spa_bt_transport *t, struct spa_loop *data_loop)
|
||||
int spa_bt_transport_ensure_sco_io(struct spa_bt_transport *t, struct spa_loop *data_loop)
|
||||
{
|
||||
if (t->sco_io == NULL) {
|
||||
t->sco_io = spa_bt_sco_io_create(data_loop,
|
||||
t->fd,
|
||||
t->read_mtu,
|
||||
t->write_mtu);
|
||||
if (t->sco_io == NULL)
|
||||
return -ENOMEM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t spa_bt_transport_get_delay_nsec(struct spa_bt_transport *t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue